[php-maint] Bug#633100: Bug#633100: bad interaction with fuser bug in psmisc 22.14-1

Ondřej Surý ondrej at debian.org
Mon Jul 18 13:38:08 UTC 2011


Hi,

since the scanning of the full /proc directory on every file in the
/var/lib/php5 is very ineffective, I am probably going to remove the
fuser call and replace it with something like this (rewritten to C for
speed and less forks and bashisms removed):

MAXTIME=$(/usr/lib/php5/maxlifetime) find /proc/ -mindepth 3 -maxdepth
3 -type l -regex '/proc/[0-9]*/fd/[0-9]*' -execdir bash -c
'X=$(readlink $0); [ -f "${X}" -a "${X:0:13}" = "/var/lib/php5" ] &&
echo touch --date="-$((${MAXTIME}/2)) min" "${X}"' {} \; && find
/var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin
+$(/usr/lib/php5/maxlifetime) ! -delete

Basically this reads the /proc just once and sets the creating time to
-maxlifetime/2 min in past.

Luka, let me know if this helps.

Ondrej

On Mon, Jul 18, 2011 at 00:25, Craig Small <csmall at debian.org> wrote:
> On Sun, Jul 17, 2011 at 11:53:37PM +0200, Luka Frelih wrote:
>> what i can confirm from investigation is that version 22.14-1 of
>> fuser uses many times more resources - cpu and ram - than the stable
>> version. why this is, i don't know. but used in the find for
> That would be the forking that goes on to protect it against hanging
> because of things like stat()ing nfs mounts etc.  It's not noticeable
> to me, but it is to a lot of other people.
>
> I'm probably going to revert the change and make it an option.
>
>  - Craig
> --
> Craig Small VK2XLZ    http://www.enc.com.au/       csmall at : enc.com.au
> Debian GNU/Linux      http://www.debian.org/       csmall at : debian.org
> GPG fingerprint:       1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
>



-- 
Ondřej Surý <ondrej at sury.org>
http://blog.rfc1925.org/





More information about the pkg-php-maint mailing list