forked from MTSR/mapserver
dynamic worker count
This commit is contained in:
parent
280010d3ba
commit
7a19cd3467
@ -5,6 +5,7 @@ import (
|
|||||||
"mapserver/coords"
|
"mapserver/coords"
|
||||||
"mapserver/layerconfig"
|
"mapserver/layerconfig"
|
||||||
"mapserver/tilerenderer"
|
"mapserver/tilerenderer"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -24,10 +25,15 @@ func Render(tr *tilerenderer.TileRenderer,
|
|||||||
|
|
||||||
jobs := make(chan coords.TileCoords, 100)
|
jobs := make(chan coords.TileCoords, 100)
|
||||||
|
|
||||||
go worker(tr, jobs)
|
fields := logrus.Fields{
|
||||||
go worker(tr, jobs)
|
"workers": runtime.NumCPU(),
|
||||||
go worker(tr, jobs)
|
}
|
||||||
go worker(tr, jobs)
|
logrus.WithFields(fields).Info("Starting initial render progress")
|
||||||
|
|
||||||
|
|
||||||
|
for i := 0; i<runtime.NumCPU(); i++ {
|
||||||
|
go worker(tr, jobs)
|
||||||
|
}
|
||||||
|
|
||||||
for _, layer := range layers {
|
for _, layer := range layers {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user