On Friday, July 12, 2019 at 1:00:03 AM UTC-7, Gaël Princivalle wrote: > > Hi all. > > In my sessions folder all sessions are stored in separated sub-folders, > 068,069... > The file system don't accept more than 512 sub-folders in a folder. > When I reach 512 sub-folders the website is down. > Now for avoiding this problem I delete all the sessions with a crontab job > every 12 hours, but it's not enough. > > Obviously I can imagine that deleting all the sessions means also > disconnecting all the users, that's not a good thing. >
You've already moved on, it seems, but there's a script in the archives (I think I reposted it once, originally from Massimo) and that script cleans up the sessions; with normal options, it deletes expired sessions only, but can delete all sessions older than x seconds, etc. My website is getting around 5 hits per second 24-7; cleaning once a day was getting dicey (in df terms, rather than directly in dir entries), so I do it twice a day now -- via scheduler -- and manually if I look in and see an issue developing. The script runs well as module called from the scheduler, and it sends me email if after cleaning df is still too low. (This is an AWS ec2 instance, so the primary disk is small; we have a second disk we archive off to; one app has a handful of uploads each week, and the uwsgi logs autorotate, but don't purge, so I still get to do housekeeping.) /dps > Can I store the sessions in the DB instead of the file system? > > And what about that? I don't understand where I must add it, and it seems > that the sessions storage for my website works already like that, > http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions > > Thanks. > > > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/0ac75c5d-8a38-4345-be86-5f742e0d44f5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.