Like a tile server for spatial image data, I want to view the many created images on the fly in my Django-based web application (image merging, color changing, etc.). Since a single client can request many (> 100) images in a short time, it is easy to cite a web server (Apache + mod_wsgi).
Therefore, I am looking for alternative ways. Since we already use Celery, it might be a good idea to do this image processing asynchronously and push the generated data to the client. To get started with this, I switched the WSGI server to gevent with Apache used as a proxy. However, I have not yet managed to get the push work to work, and I'm not quite sure if this is correct anyway. Based on this, I have three questions:
Do you think that this (Celery, gevent, Socket.IO) is a reasonable way to allow many clients to use the application without lowering the web server? Do you see alternatives?
If I pass the image processing to Celery and let him paste the image data into the browser when this is done, the connection will not go through Apache, right?
If some kind of click on the client is used, would it be better to use one connection or one for each image (and close it when it is done)?
Background:
The Django application I'm working on allows the user to display very large images. This is done by breaking up large images earlier and displaying only relevant fragments in the grid to the user. As far as I understand, this is a standard way of serving data in the field of mapping and spatial image data (for example, OpenStreetMap). But unlike the matching data, we also have many fragments in Z, the user can scroll (biological images).
All this works great when the tiles are statically served. Now I added the ability to generate these fragments "on the fly" - different images merge, colors are fixed, .... This works, but it is a big load for the web server, since one image takes about 0.1 s. We are currently using Apache with mod_wsgi (WSGIRestrictedEmbedded On), and it is easy to bring the server to failure. Just viewing the image stack will cause the web server to freeze. I already tried to configure MaxClients, etc. And disabled KeepAlive. I also tried different thread / process combinations for mod_wsgi. However, nothing helped to allow use for multiple users. So I thought the Comet / WebSocket method might help here.
tomka source share