Hi Ian, On Wed, Jun 16, 2010 at 4:11 PM, Ian McDowall <i.d.mcdow...@gmail.com> wrote: > Cool. That is a clever way to subvert (I don't mean this negatively) > the response generation. I do have a couple of comments: :-) Thanks
> 1) It relies on the response being sent to the client as it is > generated and not buffered by the server. True, although that would only affect the server, and if a server wants to be slow, who am I to tell it to be quicker.^^ The amount of data has to be sent some way or another. The client does not care, whether all the data arrives at once or slowly drips in. This is nicely seen if I reload the page, where the data comes in much more quickly. (That is also nice, one sees that data is arriving, making the wait not as bad. ) The request generates a "data.json"-response which can just be cached and subsequently sent to the client in one go. > That is clearly working for > you and I don't know the internals of the different web servers to > know if any would break this. I suspect this will work with all > servers so nice trick. I have run it under the Django internal server and apache2. It works for both. > > 2) I would be worried by resources on the web server if you expect > many connections of this type. In most servers that I have seen, each > request is assigned to a thread from a pool and the thread is not > freed up until the request is completed. Each of these requests will > tie up a thread until it is completed (I think). This is likely to > work well for a small number of simultaneous connections but if you > had more simultaneous clients than threads in your pool, I would > expect new requests to be blocked / delayed. > > If you only expect one or a small number of clients to use this > request at one time then you are fine. If you want to scale this then > I think that you may have a problem. I suggest testing this by > setting up more simultaneous clients than your server has threads set > in the pool. The test might be fiddly to set up and you could > reconfigure the server to have fewer threads and add delays into the > calculations to make it easier to test. > I am writing exams right now but I should test this sometime. Thanks for pointing it out. Cheers, Christoph -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.