raulk
raulk

Reputation: 2859

Does Opcache on PHP7 preallocate all assigned memory?

My opcache had a memory_consumption set of 512M and it was full.

So I increased it to 2048M, and restarted the php-fpm daemon. And it immediately filled up again:

Opcache issue

This site is simply running a WP Multisite installation with 2 subdomain sites. Nothing special, really. It's a low traffic site, mostly static. It does have a Woocommerce shop, but with two products only. Nothing makes me think that this amount of cache consumption is justified.

My php-fpm config has:

php_value[opcache.memory_consumption] = 2048

How can I get further insight into what's going on?

Upvotes: 3

Views: 539

Answers (1)

raulk
raulk

Reputation: 2859

The problem was in the way I had configured the opcache. I had configured it in the fpm pool by setting this property:

php_value[opcache.memory_consumption] = 2048

However, the right way of configuring it is in php.ini or in php.d:

opcache.memory_consumption=2048

Upvotes: 1

Related Questions