On Sunday, September 28, 2003, at 09:49 PM, Peter Schuller wrote:
Hello,

I just ported a small web application to Webware. Part of the application
involves sending large amounts of data to the client (file download).


For obvious reasons I don't want the response to be cached, so I invoke
commit() on the response. After that, the servlet goes into a loop the gist
of which is the following:


  while 1:
    ... book keeping
    data = file.read(50000)
    if len(data) == 0:
      break
    response.write(data)
    response.flush()
    ... book keeping

Unfortunately, inspite of the commit(), the response seems to be cached -
the client doesn't receive any data for large files and the python
process handling the requests starts consuming a lot of CPU (and
its memory usage according to top() fluctuates a lot, indicating a
lot of GC work being done, which would be consistent with
re-creating/concatenating a bunch of large buffers).

You're really supposed to do flush() instead of commit.


Do I need to do anything other than commit()?

One noteworthy point is that I am using the built-in HTTP server rather than
going through the Apache module or FastCGI. Could it be that the http-server
is cacheing the whole response?


Oh, yep, it is in the HTTPServer. My bad. I just had it collect everything in a buffer, then process it all at once -- it must have seemed easier to get working at the time. Apache and mod_webkit shouldn't do the same. You can submit a bug on this to SF if you'd like -- I won't get to it right now, but then the bug won't be forgotten.

Ian



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to