Debian Bug report logs - #631098
PHP Garbage Collection

version graph

Package: php5; Maintainer for php5 is (unknown);

Reported by: Martin Meredith <mez@debian.org>

Date: Mon, 20 Jun 2011 08:39:02 UTC

Severity: normal

Found in version php5/5.3.6-12

Done: Martin Meredith <mez@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#631098; Package php5. (Mon, 20 Jun 2011 08:39:05 GMT) (full text, mbox, link).


Acknowledgement sent to Martin Meredith <mez@debian.org>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 20 Jun 2011 08:39:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Martin Meredith <mez@debian.org>
To: submit@bugs.debian.org
Subject: PHP Garbage Collection
Date: Mon, 20 Jun 2011 09:34:32 +0100
Package: php5
Version: 5.3.6-12

I've had a problem where somehow, I've managed to end up with 
approximately 1,000,000 session files on my server.

Due to the large amount of files, the current crontab to clear them was 
unable to deal with it (xargs would fail to take in the HUGE list of files).

It seems that rather than using xargs (even with the limit), that using 
the -exec option of find might be a little bit more sane?


09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d 
/var/lib/php5 ] && find /var/lib/php5/ -type f -cmin 
+$(/usr/lib/php5/maxlifetime) -exec rm {} \;;

Is what I currently have in my cron script to work around this issue.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#631098; Package php5. (Mon, 20 Jun 2011 10:15:03 GMT) (full text, mbox, link).


Acknowledgement sent to Ondřej Surý <ondrej@sury.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 20 Jun 2011 10:15:07 GMT) (full text, mbox, link).


Message #10 received at 631098@bugs.debian.org (full text, mbox, reply):

From: Ondřej Surý <ondrej@sury.org>
To: Martin Meredith <mez@debian.org>, "631098@bugs.debian.org" <631098@bugs.debian.org>
Subject: Re: [php-maint] Bug#631098: PHP Garbage Collection
Date: Mon, 20 Jun 2011 12:12:14 +0200
Hi,

5.3.6-12 has already updated crontab file without xargs.

Ondřej Surý

On 20.6.2011, at 10:34, Martin Meredith <mez@debian.org> wrote:

> Package: php5
> Version: 5.3.6-12
> 
> I've had a problem where somehow, I've managed to end up with approximately 1,000,000 session files on my server.
> 
> Due to the large amount of files, the current crontab to clear them was unable to deal with it (xargs would fail to take in the HUGE list of files).
> 
> It seems that rather than using xargs (even with the limit), that using the -exec option of find might be a little bit more sane?
> 
> 
> 09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -exec rm {} \;;
> 
> Is what I currently have in my cron script to work around this issue.
> 
> 
> 
> _______________________________________________
> pkg-php-maint mailing list
> pkg-php-maint@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-php-maint




Reply sent to Martin Meredith <mez@debian.org>:
You have taken responsibility. (Mon, 20 Jun 2011 10:18:22 GMT) (full text, mbox, link).


Notification sent to Martin Meredith <mez@debian.org>:
Bug acknowledged by developer. (Mon, 20 Jun 2011 10:18:24 GMT) (full text, mbox, link).


Message #15 received at 631098-done@bugs.debian.org (full text, mbox, reply):

From: Martin Meredith <mez@debian.org>
To: Ondřej Surý <ondrej@sury.org>, 631098-done@bugs.debian.org
Subject: Re: [php-maint] Bug#631098: PHP Garbage Collection
Date: Mon, 20 Jun 2011 11:15:47 +0100
Ah, apologies, I just noticed that :D

Please ignore this bug :)


On 20/06/11 11:12, Ondřej Surý wrote:
> Hi,
>
> 5.3.6-12 has already updated crontab file without xargs.
>
> Ondřej Surý
>
> On 20.6.2011, at 10:34, Martin Meredith<mez@debian.org>  wrote:
>
>> Package: php5
>> Version: 5.3.6-12
>>
>> I've had a problem where somehow, I've managed to end up with approximately 1,000,000 session files on my server.
>>
>> Due to the large amount of files, the current crontab to clear them was unable to deal with it (xargs would fail to take in the HUGE list of files).
>>
>> It seems that rather than using xargs (even with the limit), that using the -exec option of find might be a little bit more sane?
>>
>>
>> 09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ]&&  [ -d /var/lib/php5 ]&&  find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -exec rm {} \;;
>>
>> Is what I currently have in my cron script to work around this issue.
>>
>>
>>
>> _______________________________________________
>> pkg-php-maint mailing list
>> pkg-php-maint@lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-php-maint





Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#631098; Package php5. (Mon, 20 Jun 2011 19:03:06 GMT) (full text, mbox, link).


Acknowledgement sent to Bob Proulx <bob@proulx.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 20 Jun 2011 19:03:06 GMT) (full text, mbox, link).


Message #20 received at 631098@bugs.debian.org (full text, mbox, reply):

From: Bob Proulx <bob@proulx.com>
To: Martin Meredith <mez@debian.org>, 631098@bugs.debian.org
Subject: Re: Bug#631098: PHP Garbage Collection
Date: Mon, 20 Jun 2011 13:00:53 -0600
Martin Meredith wrote:
> I've had a problem where somehow, I've managed to end up with
> approximately 1,000,000 session files on my server.

That is definitely a very large number of files all in one place!

> Due to the large amount of files, the current crontab to clear them
> was unable to deal with it (xargs would fail to take in the HUGE
> list of files).
>
> It seems that rather than using xargs (even with the limit), that
> using the -exec option of find might be a little bit more sane?

I realize that the cron script has already changed in later releases
but just the same this shouldn't have been a problem with the previous
version that used xargs.  Using xargs is an older but quite acceptable
way to deal with a very large list of filenames.  I think that there
was some different problem related to this that wasn't diagnosed.

In other words, while using 'find . -exec command {} +' is more
efficient than 'find . -print0 | xargs -0 command' they are both
equivalent in functionality.  And using 'find . -conditions -delete'
is even better for safety and efficiency the 'xargs -0' version is
still functionally correct.  Today it is best to use -delete since it
is newly available in find.  But before the -delete and the "{} +"
forms were available then the 'find . -print0 | xargs -0 ...' form was
the standard of excellence and will handle directories with millions
of files in it.

In yet other words, I feel certain that the actual problem was
something else and not the use of 'find . ... -print0 | xargs -0 ...'
there.  For example perhaps memory was so limited that the Linux
kernel out-of-memory killer (OOM Killer) came into place?  Just as an
example and not necessarily saying that was the specific problem you
hit.

Bob




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 19 Jul 2011 07:37:59 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 03:27:29 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.