You say "I'm using we2py in production to serve about 15 websites, each one of them is served by it's own web2py installation." Why? Why not a single web2py running? Do the difference instances run on the same server and different ports?
On Friday, 20 March 2015 17:33:15 UTC-5, Lisandro wrote: > > I'm using we2py in production to serve about 15 websites, each one of them > is served by it's own web2py installation. > > I want to clean up expired sessions every certain amount of time. To do > that, I create a file under /etc/cron.d/ for every website. The file has > the following content: > > MAILTO=root > */60 * * * www-data nohup python /var/www/mywebsite/web2py.py -S init -M > -R /var/www/mywebsite/scripts/sessions2trash.py -A -o > */60 * * * www-data nohup python /var/www/mywebsite/web2py.py -S panel -M > -R /var/www/mywebsite/scripts/sessions2trash.py -A -o > > As you can see, the cleaning is executed one per hour. I'm using two lines > for each websites, because each website has two web2py applications > running: "init" and "panel", so I clean up sessions of both of them. > > The problem is that, if I activate those lines in cron configuration, > every time they are executed I can see that memory usage of my sever goes > "to the sky" (memory is all used and the server starts to swap), also the > CPU load increases considerably, and during about 5 o 10 minutes, all the > websites throw errors. > > If I execute those lines manually, they execute and finish instantly. I > mean, there aren't too much sessions to cleanup, so the cleaning takes no > more than a few seconds. So I don't understand why the same process isn't > working when called from cron. Any tip on this? Thanks in advance! > -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.