On 03/02/2012 03:13 PM, dmitrijs.samson...@gmail.com wrote: > Hello, everybody! > I have server with php storing sessions in files. > Due to Debian changes session aging is managed by cron /etc/cron.d/ php5. > Which take a looong time (10-20m) to accomplish in my situation due to high > session count (~10k). > The slowest part of cron is fuser call and if I understand this correctly the > only purpose of it to avoid currently opened file deletion. > > If so, is this workaround appropriate? > 09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d > /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 > -ignore_readdir_race -type f -cmin +$(/usr/lib/php5/maxlifetime) > `/usr/bin/lsof -F n +d /var/lib/php5/ | /bin/grep -o "sess_.*" | /usr/bin/tr > -d "\n\r"| sed -e "s/sess_/ ! -name sess_/g"` -delete > > The idea is to generate a list of additional options for find excluding from > result all files which are currently opened by any process. > It may be not so good if there are many opened session files, but in my > environment I can see only few at a time. > > Thank you. > Dmitry Samsonov > Hi,
There has been very long discussion about this piece of scripting in the PHP maintainer list. I think that the Alioth list would be a more appropriate place to talk about it. FYI: pkg-php-ma...@lists.alioth.debian.org Thomas -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/4f50ca96.2000...@debian.org