Ok, sorry for the repeated spamming tonight. One problem with the solution you linked to is that it is extracting the gx_maxlifetime in seconds, then putting that in find's -cmin which expects minutes.
I've attached a script that incorporates the improvements of SAPI- specific session file cleaning, as well as my improved open-file touching code. Here's the difference in time on one of my production machines: # pidof php5-fpm | xargs php -r 'echo "$argc running threads\n";' 102 running threads # time /usr/lib/php5/sessionclean /var/lib/php5 $(/usr/lib/php5/maxlifetime) real 0m10.631s user 0m7.876s sys 0m2.738s # time /tmp/sessionclean_proposed.sh real 0m0.341s user 0m0.126s sys 0m0.241s ** Attachment added: "sessionclean_propsed.sh" https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1356113/+attachment/4178920/+files/sessionclean_propsed.sh -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to php5 in Ubuntu. https://bugs.launchpad.net/bugs/1356113 Title: PHP5 session clean cron job causes OOM To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1356113/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs