I store the sessions in the database, so there is no problem with a locked 
file.

I've just found something interesting that could help to figure out: when 
the problem presents, I checked the pg_stat_activity in postgres to see if 
there was a long running query, and there is indeed. But the query is a 
simple select to the auth_user table, to select the row of the logged in 
user. How can this query take that long? Does web2py lock the user row? If 
so, how do I release it?

Something to consider: in my db.py, at the end, I do this:

response.user = db.auth_user[auth.user.id] if auth.is_logged_in() else None


I think that is the query taking that long, because this is the SQL query 
that I can see in the pg_stat_activity:

SELECT  auth_user.id, auth_user.first_name, auth_user.last_name, auth_user.
email, auth_user.password, auth_user.registration_key, auth_user.
reset_password_key, auth_user.registration_id, auth_user.alta, auth_user.
plantel, auth_user.responsable, auth_user.nombre, auth_user.telefono, 
auth_user.autor, auth_user.foto, auth_user.foto_temp, auth_user.moderador, 
auth_user.descripcion, auth_user.facebook, auth_user.twitter, auth_user.
linkedin, auth_user.gplus FROM auth_user WHERE (auth_user.id = 2) LIMIT 1 
OFFSET 0;


So, I think the problem is related to that sentence where I need to 
retrieve the row of the logged in user and store it in a variable inside 
response object.
What do you think?



El martes, 3 de abril de 2018, 8:29:09 (UTC-3), Leonel Câmara escribió:
>
> I would use redis for sessions instead of the default file based ones, it 
> makes the site a lot quicker and it would probably solve your problem as I 
> would bet this is happening due to a locked session file.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to