To clean up session on my production environment I thought of calling the 
sessions2trash.py this way:

nohup python ~/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py -A -o -x 3600 -f -v -s &
nohup python ~/webapps/w2p/web2py/web2py.py -S myleonexus -R 
scripts/sessions2trash.py -A -o -x 3600 -f -v -s &


At Webfaction they said:

But note that cron jobs are better for such periodic tasks rather than 
having a long-running process which consumes memory unnecessary.


So I added the following lines to my cron tab:

*/5 * * * * ~/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py &
*/5 * * * * ~/webapps/w2p/web2py/web2py.py -S mypynex -R 
scripts/sessions2trash.py


Which resulted in my processes being killed:

Memory usage way over your limit - processes killed

pynex - 14MB - 0:56:16 - 345414 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S mypynex -R 
scripts/sessions2trash.py
pynex - 13MB - 0:56:16 - 345443 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py
pynex - 21MB - 0:51:16 - 353628 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S mypynex -R 
scripts/sessions2trash.py
pynex - 23MB - 0:51:16 - 353655 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py
pynex - 23MB - 0:46:16 - 364722 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S admin -R 
scripts/sessions2trash.py
pynex - 21MB - 0:46:16 - 364740 - python 
/home/pynex/webapps/w2p/web2py/web2py.py -S mypynex -R 
scripts/sessions2trash.py

and so on ...

I have no idea why this happens and how to solve the issue, I hope one of 
you can explain why this doesn't clean up sessions correctly.


Regards,

Anne

-- 
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