Difference between php-cli and php-fpm mode in regard to APC/APCu
Asked Answered
E

1

5

The thought start from this question under php-cli mode:

PHP apc/apcu cache do not keep intermediate result while shmop do, why?

In this case, APC/APCu do not cache the intermediate result.

However, APC/APCu do cache the intermediate result just as the shmop when under php-fpm mode. So, what's the difference between php-cli and php-fpm when in regards to APC/APCu?

Elum answered 29/6, 2016 at 12:45 Comment(0)
F
15

php-fpm ist running in its own process all the time. It can use apc because it uses continuously the ram over several requests. The memory is only released through the garbage collector or if you kill the fpm process. But the a CLI process lives only for one command and when its finished the memory is released. So apc cannot store any data over severel cli calls because it allocates new memory in the ram each call.

Flophouse answered 29/6, 2016 at 12:58 Comment(2)
what about normal php-cgi mode?Elum
Its not possible to use APC in normal php cgi. Using fpm or the apache php module is the only way i know to use apc.Flophouse

© 2022 - 2024 — McMap. All rights reserved.