Kotaimen / maps-Brick

A Mason's Brick - High Quality OSM Street & Terrain Map
2 stars 1 forks source link

Rendering issues in mapnik-2.3 branch #10

Open Kotaimen opened 9 years ago

Kotaimen commented 9 years ago
  1. Slow render speed at lv 7-12
  2. Huge memory consumption (4x4 metatile at level 7 took 30GB memory)
  3. Sometimes render hangs up
Kotaimen commented 9 years ago
  1. Landuse layer requires too many data at level 7-9, maybe add a landuse_gen2
  2. Caused by cache-features layer options, disables it fixes the problem but migrates the huge stress on the database (and pgbouncer)
  3. Caused by duo connection pool deadlock, explained below:

Current setup:

It seems mapnik's async postgis datasource connection pool won't drop idle async connection before a render is completed. When database load is high, large query take several minutes to complete, if one of the async connection is blocked due to pgbouncer server pool size limit, entire render is blocked:

pgbouncer=# SHOW POOLS;
 database  |   user    | cl_active | cl_waiting | sv_active | sv_idle | sv_used | sv_tested | sv_login | maxwait
-----------+-----------+-----------+------------+-----------+---------+---------+-----------+----------+---------
 imposm3   | postgres  |        54 |          15 |        40 |       0 |       1 |         0 |        0 |       0
 pgbouncer | pgbouncer |         1 |          0 |         0 |       0 |       0 |         0 |        0 |       0
(2 rows)

Solution:

  1. Disable async rendering (async render at level 15-19 is 20% faster than sync)
  2. Disable mapnik connection pool (we have pgbouncer for pooling anyway)
  3. Increase pgbouncer server pool size...

Currently i'm using 3 as temporary solution. Need to test 1. and 2.

@GlieseRay: any ideas?