mapnik / node-mapnik

Bindings to mapnik for node.js
http://mapnik.org/documentation/node-mapnik
BSD 3-Clause "New" or "Revised" License
531 stars 165 forks source link

How can I extend the postgresql connection in just one node.js instance. #971

Open dadiorchen opened 3 years ago

dadiorchen commented 3 years ago

Hi, I'm using the mapnik in my tile server, and use Express to handle the request, and for every request I will initial a mapnik instance to render the tile image, it works fine, the question is, it seems that there is a limitation for multiple request, the PostgreSQL shows that the concurrent connection count is low, how can I set up the node app to increase the concurrent connection to the DB to improve the throughout? Thanks.

arbrisseaux commented 2 years ago

You can try to increase the environement variable UV_THREADPOOL_SIZE and you can use a node.js pooling library to reuse the same map objects between requests.