[OpenLayers-Users] Optimal tile size for tilecache
Christopher Schmidt
crschmidt at metacarta.com
Tue Oct 20 10:27:41 EDT 2009
On Tue, Oct 20, 2009 at 04:25:01PM +0300, Adrian Popa wrote:
> Thank you,
>
> I'll try with mod_python.
>
> Another small question - is there any notable speed difference between
> using tilecache (let's say through mod_python) to serve some pre-cached
> tiles and using OpenLayers.Layer.Tilecache to serve the same pre-cached
> tiles?
Some. The key difference is that serving pre-cache tiles can be done on much
lower resource webservers. mod_python can get bulky, but Layer.TC can
read from a minimal webserver like lighthttpd, etc. that tileCache itself
wouldn't want to be run on.
> I'm thinking if I should pre-cache my whole map and use Layer.Tilecache
> or if I can get away by using tilecache.py...
You probably don't need to pre-cache your whole map. You will see a
tremendous speedup switching to mod_python.
> Has anyone done any benchmarks for these methods? If the speed
> difference isn't that great, I wouldn't sacrifice the disk space...
The speed difference is not quite nonexistent, but is negligable for
anything but the most demanding use case (hundreds of users, etc.)
> Thank you.
>
> Christopher Schmidt wrote:
>> On Tue, Oct 20, 2009 at 09:43:35AM +0300, Adrian Popa wrote:
>>
>>> Hello Christopher,
>>>
>>> Thanks for your reply.
>>>
>>> I am using cgi mode (because it's been the easiest to setup). How do
>>> you recommend I run tilecache? I don't want to precache my whole map
>>> because most of the zoom levels (in some areas) don't give much
>>> information. I could precache some zoom levels and let the details be
>>> rendered on the fly, when needed...
>>>
>>
>> Okay, using CGI is the problem. You can only get about 10 tiles/second
>> with CGI, compared to hundreds with WSGI, mod_python, etc. So I recommend
>> setting up mod_python or some other persistant server side process for
>> serving the tiles, rathere than using CGI, which is much slower.
>>
>>
>>> I'm not using metatiles (or at least I think I'm not using them)... I
>>> don't really know what metatiles are and what they are supposed to
>>> do. Maybe a point to the right documentation would be ok...
>>>
>>
>>
>>
>>
>>> The tile loading process goes like this - when I change my zoom the
>>> center tiles are loaded pretty quickly (even if they haven't been
>>> cached) - in about half a second, but the edges of my image take
>>> about ~5 seconds to load. I thought it might be a limitation of my
>>> browser - on how many connections it can keep - so I added a lot of
>>> connections (20 per server) both on my browser and my web server
>>> (20 processes listening). The speed limitation is visible even when
>>> the tiles (for that area) have been cached. I thought that by
>>> increasing the tile size the browser would make fewer requests and
>>> the page would maybe load faster...
>>>
>>> Thanks,
>>> Adrian
>>>
>>>
>>>
>>> Christopher Schmidt wrote:
>>>
>>>> On Mon, Oct 19, 2009 at 02:30:44PM +0300, Adrian Popa wrote:
>>>>
>>>>> Hello everyone,
>>>>>
>>>>> Just wondering - what would be a good tile size to be used for
>>>>> tilecache, so that the client will not do a lot of queries to the
>>>>> server (seems they take quite a while), and at the same time
>>>>> would not load too much information that is not used (areas of
>>>>> tiles which are outside the viewable area).
>>>>>
>>>>> My web clients use screen resolutions starting from 1200x1024
>>>>> (and usually run the page in full screen).
>>>>> Right now I have tiles of 256x256 - which seem rather small and
>>>>> take some time to load.
>>>>>
>>>> I would try to understand why they take some time to load. Are you using
>>>> CGI mode? (Don't.) Are you not-precaching as much as you should? Are you
>>>> using metatiles? Are you not using metatiles? etc.
>>>>
>>>> Also, some description of 'some time' -- hundreds of milliseconds, seconds,
>>>> dozens of seconds -- would probably also be appropriate.
>>>>
>>>>
>>>>> What tile sizes do you use?
>>>>>
>>>> 256x256. And so does Google Maps, which was doing this before most of us,
>>>> and probably has a decent idea on how to make things work pretty well.
>>>>
>>>> -- Chris
>>>>
>>>>
>>>>> Thanks,
>>>>>
>>>>> Adrian
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing list
>>>>> Users at openlayers.org
>>>>> http://openlayers.org/mailman/listinfo/users
>>>>>
>>>>
>>>
>>
>>
>
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list