zendtech / ZendOptimizerPlus

Other
914 stars 142 forks source link

Consistency for opcache.max_accelerated_files #145

Closed remicollet closed 10 years ago

remicollet commented 10 years ago

From README

The number is actually the first one in the following set of prime
numbers that is bigger than the one supplied: { 223, 463, 983, 1979, 3907,
7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }. Only numbers

Make default value + opcache.ini consistent with this (so 3907 instead of 2000, as this is the real value used)

Also report the real value in opcache_get_configuration.

dstogov commented 10 years ago

Hi Remi,

I understand your point, but I don't like to spread implementation details over the source. For example, in case we change hash table implementation to use power of two instead of prime numbers, now we would change it in one place + documentation. with your patch we'll have to keep in mind few other places.

Also, I hardly ever expect people to calculate prime numbers to use them in php.ini, but in case any one like it, they are allowed to do it without the patch.

Thanks. Dmitry.

remicollet commented 10 years ago

I understand

Can you consider "only" the change to zend_accel_hash_init to have correct "used" value reported in opcache_get_configuration ?

dstogov commented 10 years ago

The actual number of hash table is reported by opcache_get_status() in "max_cached_keys" field. opcache_get_configuration() reports exactly what you set in php.ini.

It's not a big problem to change it, because both solutions (existing and your) may make sense. I just don't see a reason for change.

Thanks. Dmitry.

On Wed, Oct 30, 2013 at 4:45 PM, Remi Collet notifications@github.comwrote:

I understand

Can you consider "only" the change to zend_accel_hash_init to have correct "used" value reported in opcache_get_configuration ?

— Reply to this email directly or view it on GitHubhttps://github.com/zendtech/ZendOptimizerPlus/pull/145#issuecomment-27385667 .