r/PHPhelp • • Apr 30 '26

PHP-FPM vs PHP-CLI

I'm running some simple PHP 8.5 tests (empty loop, open database connection, ...) on a MacBook Pro with Debian in a UTM VM.

With exactly the same code fragment, CPU usage is always 2–3 times higher with PHP-FPM than with PHP-CLI.

Is this normal? Or does it have to do with my settings?
4 Upvotes

20 comments sorted by

View all comments

Show parent comment

1

u/Takeoded May 01 '26

hell no, that is not normal. Any chance your php-cli is compiled with -O2 (the default) and your php-fpm is compiled with -Og or something like that? phpinfo() contains the compile options, can you post them?

1

u/tc712bb May 02 '26
I use the PPA from deb.sury.org for PHP (and the apache2 webserver).
There is no 'Configure Command' in the phpinfo output.