• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Session cleaner takes long and slows host

    Scheduled Pinned Locked Moved Solved
    Bug Reports
    3
    6
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Frank
      last edited by

      Hi,
      you know there is a cron job related to php which clean sessions, which code is this:

      Look for and purge old sessions every 30 minutes

      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

      As the comment says, it runs every 30 minutes. The problem is that it is taking a long time, more than the 30 minutes, so another process is launched. And this on an on. So the host get slow. But didn’t happen before so I am wondering if it has something to do with a bug in fog session management.

      Can it be possible?

      Thanks.

      Frank

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        I suppose it’s possible, but I haven’t done any major session changes in a LONG time.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          [url]http://serverfault.com/questions/422723/ubuntus-garbage-collection-cron-job-for-php-sessions-takes-25-minutes-to-run-w[/url]

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • F
            Frank
            last edited by

            Thanks Tom. I also found that page and I was trying to implement memcache 🙂
            At the moment is actually fast but sessions expire too soon I don’t know why.
            Thanks anyway for your quick response.
            Regards,

            Frank

            1 Reply Last reply Reply Quote 0
            • JunkhackerJ
              Junkhacker Developer
              last edited by

              this is a known bug in ubuntu’s config. it’s running fuser for each PHP session file easily racking up thousands of processes. edit /etc/cron.d/php5 line [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[/CODE] to be [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[/CODE]

              signature:
              Junkhacker
              We are here to help you. If you are unresponsive to our questions, don't expect us to be responsive to yours.

              1 Reply Last reply Reply Quote 0
              • F
                Frank
                last edited by

                Ok, thanks a lot Junkhacker I will change it.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post

                243

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project