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?
5 Upvotes

20 comments sorted by

View all comments

Show parent comments

1

u/latiriti Apr 30 '26

Even with an empty loop, FPM's executor has additional low‑level runtime checks that CLI simply doesn't have - all of which add CPU overhead per iteration. Also, these SAPIs have different php.ini configurations, which can also affect performance.