#1098382 phpsessionclean memoryleak

#1098382#5
Date:
2025-02-19 21:08:14 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***
● phpsessionclean.service - Clean php session files
     Loaded: loaded (/lib/systemd/system/phpsessionclean.service; static)
     Active: activating (start) since Wed 2025-02-19 20:39:03 UTC; 26min ago
TriggeredBy: ● phpsessionclean.timer
   Main PID: 11639 (sessionclean)
      Tasks: 6 (limit: 37363)
     Memory: 19.5G
        CPU: 26min 23.438s
     CGroup: /system.slice/phpsessionclean.service
             ├─11639 /bin/sh -e /usr/lib/php/sessionclean
             ├─11640 /bin/sh -e /usr/lib/php/sessionclean
             ├─11641 sort -rn -t: -k2,2
             ├─11642 sort -u -t: -k 1,1
             ├─11644 /bin/sh -e /usr/lib/php/sessionclean
             └─11651 /usr/bin/php8.2 -c /etc/php/8.2/apache2/php.ini -d "error_reporting='~E_ALL'" -r "foreach(ini_get_all(\"session\") as \$k => \$v) echo \"\$k=\".\$v[\"local_value\"].\"\\n\";"

Feb 19 20:39:03 omen systemd[1]: Starting phpsessionclean.service - Clean php session files...
× phpsessionclean.service - Clean php session files
     Loaded: loaded (/lib/systemd/system/phpsessionclean.service; static)
     Active: failed (Result: oom-kill) since Wed 2025-02-19 21:07:16 UTC; 5s ago
TriggeredBy: ● phpsessionclean.timer
    Process: 11639 ExecStart=/usr/lib/php/sessionclean (code=exited, status=0/SUCCESS)
   Main PID: 11639 (code=exited, status=0/SUCCESS)
        CPU: 27min 49.966s

Feb 19 20:39:03 omen systemd[1]: Starting phpsessionclean.service - Clean php session files...
Feb 19 21:07:16 omen sessionclean[11640]: Killed
Feb 19 21:07:15 omen systemd[1]: phpsessionclean.service: A process of this unit has been killed by the OOM killer.
Feb 19 21:07:16 omen systemd[1]: phpsessionclean.service: Failed with result 'oom-kill'.
Feb 19 21:07:16 omen systemd[1]: Failed to start phpsessionclean.service - Clean php session files.
Feb 19 21:07:16 omen systemd[1]: phpsessionclean.service: Consumed 27min 49.966s CPU time.

#1098382#10
Date:
2025-02-19 21:36:37 UTC
From:
To:
My guess is that you somehow managed to accumulate 20GB worth of filenames.

There's nothing that can be done about that from this side, you'll need to clean
the directories by hand (probably by just deleting them).

If you plan to work with such large volumes, you'll have to change the session
cleaning to suit your deployment. There's no generic solution for this kind of
volumes of session files.

Ondrej
--
Ondřej Surý (He/Him)
ondrej@sury.org

#1098382#17
Date:
2025-02-19 22:13:09 UTC
From:
To: