PHP8.1-FPM always at 0MIN in uptime

I’ve noticed that the PHP8.1-FPM service on my Hestia server consistently displays an uptime of 0 minutes. I’m unsure whether this is normal behavior or if there might be an underlying issue that needs attention.

My main concern is whether this abnormal uptime reading could potentially affect the processing of PHP scripts on my server. Could you kindly advise whether it’s common for PHP8.1-FPM to show 0 minutes in uptime or if there might be something I need to investigate further?

If this situation is indeed unusual, could you provide some initial guidance on what I should look into to troubleshoot and resolve this matter? Any pointers on logs, configurations, or potential areas of concern would be greatly appreciated.

Thank you for your time and attention to my inquiry.

For context, I run two versions of PHP on my server. One 8.0 and one 8.1, the 8.1 is the one constantly at 0 uptime.

First thing you should check is the status and the systemd log:

systemctl status php8.1-fpm.service
journalctl -xeu php8.1-fpm.service
towysudo@Towux:~$ systemctl status php8.1-fpm.service
● php8.1-fpm.service - The PHP 8.1 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php8.1-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-08-24 18:21:44 CEST; 38min ago
       Docs: man:php-fpm8.1(8)
    Process: 129874 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81>
   Main PID: 129873
     Status: "Processes active: 2, idle: 6, Requests: 2514, slow: 0, Traffic: 1.5req/sec"
      Tasks: 6 (limit: 9159)
     Memory: 932.0M
        CPU: 36min 11.114s
     CGroup: /system.slice/php8.1-fpm.service
             ├─129873 "php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
             ├─142460 "php-fpm: pool jenny.airreps.info" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─142875 "php-fpm: pool jenny.airreps.info" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─142877 "php-fpm: pool jenny.airreps.info" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─143377 "php-fpm: pool airreps.link" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
             └─143405 "php-fpm: pool hicitypods.com" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

Seems to be running fine? That’s odd.
Hestia:

Maybe Hestia is bugged?

It seems so because what HestiaCP does to check the uptime is:

pidof php-fpm8.1

and in your case it will get

143405|143377|142877|142875|142460|129873

And the uptime will be calculated with the first pid (143405) that is a pool started maybe a few seconds ago instead of calculate the uptime with the pid for master process (129873), if it was used to calculate the uptime you would see an uptime of 38 mins.

You should open an issue in github so devs can take a look.

Anyways, in this case, you shouldn’t be worried by the uptime :wink:

Okay, thanks a lot for your answer!

1 Like

If you want to test a possible fix, you could try this:

Backup v-list-sys-services script:

cp /usr/local/hestia/bin/v-list-sys-services /root/v-list-sys-services.original

Edit file /usr/local/hestia/bin/v-list-sys-services and in line 105 change this:

pid=$(echo "$pids" | cut -f 1 -d '|')

to this:

pid=$(echo "$pids" | awk -F '|' '{print $NF}')

Save the file and check again the uptime.

Just for the records, this is the PR that should solve this issue:

3 Likes

Thanks merged :slight_smile:

1 Like