[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rapidly proliferating sess files in /tmp, eating inodes



On 24/05/14 12:04, Jerry Stuckle wrote:
> On 5/23/2014 11:41 PM, Richard Hector wrote:
>> On 24/05/14 12:27, Jerry Stuckle wrote:
>>> So, where is it storing files now?  Just because they aren't in /tmp
>>> doesn't mean they don't exist - and won't eventually use up your inodes.
>>
>> Except that if they're in the 'normal' place (/var/lib/php5), there's
>> probably a cronjob (/etc/cron.d/php5) to clean up the stale ones.
>>
>> Richard
>>
>>
> 
> Richard,
> 
> No, this is not the "normal" place.  These are considered temporary
> files, and if there is no entry in the php.ini files, they go into the
> system temporary directory (which *generally* is /tmp, but that's why I
> asked).
> 
> And no, there is no cron job to clean up old session files.  After they
> have expired, they are eligible for cleanup, but this will not occur
> until PHP's session cleanup code runs (which is dependent on settings in
> the php.ini file).
> 
Hmm, I see this in my syslog every hour:

May 24 12:09:01 vanderhoff /USR/SBIN/CRON[24431]: (root) CMD (  [ -x
/usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find
/var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f
-ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir
fuser -s {} 2>/dev/null \; -delete)

I don't pretend to understand it in detail, but I always assumed that
this was cleaning up stale session files. Therefore the 'normal' place
*is* /var/lib/php5/.

Cheers, Tony

-- 
Tony van der Hoff        | mailto:tony@vanderhoff.org
Buckinghamshire, England |


Reply to: