Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: fuser forking uncontrollably in cron job

  1. #11
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: fuser forking uncontrollably in cron job

    Hi

    Quote Originally Posted by Hizeh View Post
    I tried matt_symes fix and the "lsof -t" does not fork uncontrollably like fuser was doing.

    But, I'm not sure how to check if it is actually clearing old PHP sessions.
    Not so much a fix; more of a stab in the dark

    Can you post your cron job script so i can take a look ?

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  2. #12
    Join Date
    Feb 2008
    Beans
    2

    Re: fuser forking uncontrollably in cron job

    To find the file use the command below:

    Code:
    find /etc/cron.* -type f -exec grep -Hi fuser {} \;
    /etc/cron.d/php5 is the file to edit.

    EDIT: worley already posted the file name in his latest post.
    Last edited by bigchirv; October 20th, 2011 at 05:20 AM.

  3. #13
    Join Date
    Sep 2008
    Beans
    3

    Re: fuser forking uncontrollably in cron job

    We found the same problem on 11.10 and the solution is to take out the "fuser" part.

    This is the content of /etc/cron.d/php5 on 11.10:

    Code:
    09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete
    And this is the content on 11.04:

    Code:
    09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete
    Spot the difference?

    The 11.10 version runs fuser for each PHP session file, using all the CPU when there are hundreds of sessions. The reason it doesn't happen on 11.04, is 11.04 doesn't call fuser.

  4. #14
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: fuser forking uncontrollably in cron job

    Hi

    The 11.10 version runs fuser for each PHP session file, using all the CPU when there are hundreds of sessions. The reason it doesn't happen on 11.04, is 11.04 doesn't call fuser.
    Interesting. Does anybody know why it was added ? Why would a process still reference the file after its supposed maximum lifetime ?

    My assumption would be to deal with some edge condition because it is pretty obvious what they were trying to achieve by adding it.

    Kind regards
    Last edited by matt_symes; October 20th, 2011 at 01:03 PM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  5. #15
    Join Date
    Oct 2011
    Beans
    1

    Re: fuser forking uncontrollably in cron job

    Upgrade my server 2 days ago and got all kind of strange 'can not fork' error to.

    I can confirm that I had lots of defunct fuser processes. So I changed the php5 session cleanup cron to the 11.04 version and now all is fine again

  6. #16
    Join Date
    Jan 2010
    Beans
    27

    Re: fuser forking uncontrollably in cron job


  7. #17
    Join Date
    Nov 2011
    Beans
    1

    Re: fuser forking uncontrollably in cron job

    Hi

    I have this problem with my Ubuntu server 11.10 and I fixed problem by editing /etc/cron.d/php5 and replace the codes with:

    Code:
    09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete
    Now everything works fine!

    Thanks all

  8. #18
    Join Date
    Feb 2008
    Beans
    1

    Smile Re: fuser forking uncontrollably in cron job

    I applied the afshinm modification, and it works for me too.

    Thanks !

  9. #19
    Join Date
    Sep 2005
    Beans
    23

    Re: fuser forking uncontrollably in cron job

    I hadn't see much in the way of load issues, but I have been getting some errors from exim that may be related:
    daemon: accept process fork failed: Cannot allocate memory
    Which I though was weird since I never saw memory issues either.

    I had been getting some complaints about my website being down for short intervals intermittantly, but could never catch that either.

    I only just caught this today after logging in and seeing the message "you have xxxx zombie processes"

    I've applied the lsof/fuser switch in the cron file. Hopefully that fixes it (and my other issues).

  10. #20
    Join Date
    May 2009
    Location
    St. Pete, FL
    Beans
    10
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: fuser forking uncontrollably in cron job

    Just ran into this same problem today. Funny thing is I upgraded from 11.04 to 11.10 back in October and never noticed it until now. I just happened to be working on something else when suddenly I found hundreds of defunct fuser processes slowing the server down. Made the change suggested above and that seems to have helped.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •