Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Massimo Di Pierro
Try replace request.body = copystream_progress(request) ### stores request body with try: request.body = copystream_progress(request) ### stores request body except IOError: raise HTTP(400,"Bad Request - HTTP body is incomplete") in main.py. Does the problem

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruce Wade
I personally think if we are just going to leave it as it, then we should not have it create an error ticket as I have had plenty of tickets created by this. On Mon, Jul 16, 2012 at 7:13 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > The more I think about this the more I am convinc

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Niphlod
You're right, it's 1 query per request more (2 if session is updated), but it's a pkey lookup (and eventually an update) vs scan a dir, open file, lock it, read it, (eventually save) and close it. Without available perftest I tend to agree that file-based session in separate folders is better

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruce Wade
Storing them in the database will slow down your website depending on which database, how many users and how many sessions you create. On a heavy hit site the DB is going to slow down a lot. I am trying to figure out a way how to handle sessions on the client site as secure as possible so the serv

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Niphlod
I'm storing sessions on database for my app with no apparent problems (1.99.7 stable) for storing them in redis, currently there is no way (sorry). When I implemented cache in redis it seemed that I was the only one using a redis stack along web2py...generally redis adoption is quite sparse

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruno Rocha
I tested putting sessions in database, but for some strange reason, when sessions are in db, user are not redirect to login._next after the login, and other issues. Also I think sessions in db gets a bit slower. I am planning to test sessions in redis. On Mon, Jul 16, 2012 at 1:01 PM, Bruce Wade

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruce Wade
That I/o warning shouldn't take down your site I have the same issue with linode. I think sessions need to be done differently especially on high load sites with a load balancer sometimes I find over 400,000 files in the session folder on each server × 4 On Jul 16, 2012 8:14 AM, "Bruno Rocha" wrot

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruno Rocha
I am having a related problem. "Your Linode, blouserver, has exceeded the notification threshold (1000) for disk io rate by averaging 1382.77 for the last 2 hours: I receive this message every 2 hour, so my nginx get bas gateway and I need to do "rm sessions/* " and also "/etc/init.d/uwsgi resta

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Massimo Di Pierro
This may be related to a bug in rocket that was not catching timouterror and occasionally sending/receiving incomplete requests. Try upgrade rocket.py yo trunk. You can leave everything unchanged. Let us know if the error go away. It is also possible that the request is actually invalid (the br

Re: [web2py] Re: Help! IOErrors

2012-07-16 Thread Bruce Wade
I am using the latest stable still. On Mon, Jul 16, 2012 at 7:58 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Which web2py version? The error is from copying the request body into a > tmp object in web2py. Looks like the request declares a size in the header > but it is shorter (t