Closed zdila closed 5 years ago
Workaround - run 2 processes:
It is not the cleanest approach as it eats twice memory resources.
It is not the cleanest approach as it eats twice memory resources.
You can save that memory by forking the prerender process from the on-demand process once Mapnik styles are loaded. In such case all read-only memory will be shared between those processes in Linux.
I can fork in nodejs but I am afraid I can't set the fork nice level.
It should be possible to set nice of a process at any time.
I couldn't find such API in nodejs. Just fork.
But still stopping and resuming mapnik instance would keep it's memory allocated so my workaround is not any worse and it already works :)
Is there a way to suspend and resume rendering of a map (tile)?
Our usecase is that mapnik pre-renders all tiles using all CPU cores but during that time user can request some not-yet-prerenderred tile and that should have highest priority. In that case we would like to suspend pre-rendering of some tile and start rendering user-requested one.
Currently we only ask a mapnik instance from a pool with higher priority, but if all workers are runinng (pre-rendering) then a process must wait for a worker to finish.
We use node-mapnik.