mapnik / mapnik-support

Use the issues queue here to ask questions and offer help on using Mapnik (maybe if this works well we can retire the mailing list at http://mapnik.org/contact/?)
6 stars 6 forks source link

Mapnik with nodejs is not using more than 4 cores #114

Closed zdila closed 5 years ago

zdila commented 5 years ago

Hello,

I can't make use of more than 4 cores on my 8 core machine (4 cores with hyperthreading) with Mapnik. I am using the same approach as in mapnik-pool and even if I set like 16 workers I observe only 4 cores to be fully utilized.

I tried to run my nodejs app twice in parallel and then I saw it using 8 cores (4 per one). Is there any limit directly in the node mapnik implementation to limit cores per app?

talaj commented 5 years ago

Node Mapnik is using uv_queue_work() to spawn a work on its own thread.

The documentation is saying:

Its default size is 4, but it can be changed at startup time by setting the UV_THREADPOOL_SIZE environment variable to any value (the absolute maximum is 128).

Hope it will help.

Cheers!

zdila commented 5 years ago

Thanks @talaj, I'll try it in the evening and report the status here :-).

Just for the reference my project is at https://github.com/FreemapSlovakia/freemap-mapnik

zdila commented 5 years ago

Provided solution works. Thanks again!