On Jul 20, 1:58 pm, Michael Toomim <too...@gmail.com> wrote: > Thanks! I tried rebooting the OS. Now my resources seem ok (but I > didn't check before the reboot): > > Files used: 1376 out of 75556 > Mem used: 580mb out of 796mb > Swap used: 0 > CPU: 88-99% idle > > And I know longer see the "Exception occurred" or "IOError" messages, > however I DO still see "Premature end of script headers". These > errors come in batches, every 10-20 seconds or so I get a continuous > block of 10-20 "Premature end of script headers" errors from different > clients. These are followed by errors notifying me that clients' ajax > requests failed. > > I also found three of these in my web2py tickets: > > Traceback (most recent call last): > File "gluon/main.py", line 337, in wsgibase > parse_get_post_vars(request, environ) > File "gluon/main.py", line 222, in parse_get_post_vars > request.body = copystream_progress(request) ### stores request > body > File "gluon/main.py", line 95, in copystream_progress > copystream(source, dest, size, chunk_size) > File "gluon/fileutils.py", line 301, in copystream > data = src.read(size) > IOError: request data read error > > However, I've gotten around 3000 "premature end of script" errors, and > only 3 of these IOErrors. > > Is there a way to identify what is causing the "Premature end of > script" errors?
They can also occur if you have set maximum-requests to a very low value and have long running requests which are being interrupted when process is forcibly restarted. You should not use maximum-requests in a production system if you can avoid it. If you have memory/resource leaks in your application then fix them rather than relying on periodic restarts. Graham