mapbox/tilemill — Issue #1150: CPU spike and 6 second hang due to failure to load XML
Author: springmeyer
Created: 2012-01-13 22:10:02+00:00
State: open
Labels: wishlist

I've been testing error reporting again to ensure that if (in this case) a mapnik postgres layer connection fails the error properly displays in the UI. After #1101 this appears to be working, except that the error does not appear on my machine for 6-10 seconds. Also I notice that CPU spikes at near 100% during this wait, and dtrace shows an enormous amount of mutex locking (http://cl.ly/3Y0X0z392t3x2m1g1U0x) in the libxml2 and boost functions called by mapnik.

Print statements at https://github.com/mapbox/tilelive-mapnik/blob/master/lib/mapnik.js#L204 indicate that for a single browser refresh on my broken project that `map.fromString()` is called up to 20 times, which I think would explain the locking (because of so much concurrent loading) and the high CPU (because of such contention over locks).

Viewing a single tile url, of course, returns instantly.