Vinu D
Vinu D

Reputation: 112

PHP OpCache optimisation

I have enabled opcode caching in php, and it delivers savings in pageloads to the extent of 25%.

I use the excellent OpCache.php GUI tool, and my output is as below.

Keys output is as below. enter image description here

Hits output is as below. enter image description here

I am trying to understand some of the basic features in there.
1. What are cached keys and free keys ?
2. How do I reduce my misses ? I read somewhere that opcache_hit_rate should be above 99%. Is there a way to go about this fine tuning. I am currently at 91%
3. How is the visualization to be used ?

I am a beginner to this and would appreciate any help. Many thanks.

Upvotes: 2

Views: 1440

Answers (1)

user149341
user149341

Reputation:

  1. For technical reasons, the PHP opcode cache stores values in a fixed set of "bins", referred to here as "cache keys". The ratio of cache keys to free keys is a rough indicator of how full the cache is.

  2. Your miss rate is high right now because you haven't used your application very much -- by my guess, I'd say there have been around eleven requests to your application since your web server started up. This is normal; the first few requests will always result in misses, because the files involved haven't been loaded into the cache yet.

  3. Generally speaking: ignore it. Unless your application is performing poorly or misbehaving in a way that you believe is related to the cache, you don't need to look at this.

Upvotes: 6

Related Questions