[Openstreetmap] Re: Server Performance

Raphaël Jacquot sxpert at esitcom.org
Wed Jan 4 15:29:41 GMT 2006

Christian van den Bosch wrote:

> Currently, tiles are 256x128px, and the viewing pane is 700x500px (to 
> fit on an 800x600 screen?), which works out to 2.73x3.90 tiles; we 
> always fetch 4x5 tiles (=1024x640px), though sometimes (around 33% of 
> the time) this means we unnecessarily fetch a row or column or both. If 
> we changed the pane to 768x512px (3x4 tiles), we would gain around 12% 

800x600 is obsolete.
the pane size should be 768*512

> Supertiles:
> Would it be feasible for the server to combine requests for contiguous 
> tiles into a super-tile operation (perhaps on receiving an "I'm about to 
> ask for these 20 tiles" notification from the client), then splitting 
> that into the requested tiles and putting these into the cache ready for 
> the "proper" request?

that would make the javascript more complicated.
perhaps, asking for the tiles in a spiralling fashion as google maps do 
it may be simpler

> This would significantly reduce (by a factor of 20, assuming no caching) 
> the number of node/segment select operations to generate a given group 
> of tiles, while the total number of rows returned would reduce slightly, 
> because any segments that cross a tile boundary will be returned once 
> instead of twice - as an added bonus, reducing (but not eliminating) the 
> artifacts we currently see where segments are shown in tiles containing 
> their end nodes, but go AWOL in intermediate tiles.

true, but it would reduce the effectiveness of the browser's caching 

> Eliminating false negatives efficiently:
> Taking this approach a little further, a little geometry lets us 
> conclude that if both ends of a segment fall beyond the same edge of a 
> tile, the tile and segment won't intersect; we could use this, but it 
> means our select making twice as many comparisons as it currently does, 
> something like (forgive my pseudo-SQL): SELECT segments WHERE NOT ( 
> (segment.node1.x < tile.minx AND segment.node2.x < tile.minx) OR 
> (segment.node1.x > tile.maxx AND segment.node2.x > tile.maxx) OR 
> (segment.node1.y < tile.miny AND segment.node2.x < tile.miny) OR 
> (segment.node1.y > tile.maxy AND segment.node2.x > tile.maxy) ).

better yet, select all lines, and do the calculations in the script 
prior to drawing the lines
of course, the better solution would be to contribute geometry culling 
to cairo

More information about the talk mailing list