OPcache: Memory Usage = 100% (is this good or bad?)

OPcache: Memory Usage = 100% (is this good or bad?)

by Fernando Oliveira -
Number of replies: 6
Picture of Plugin developers

Hello,

We recently upgraded to PHP 5.5 on our Debian server so as to use OPcache. Unfortanetly, we haven't seen much improvement in performance.  Here is a screenshot of the OPcache Overview page: http://screencast.com/t/V2MvjlY9F

Notice that Memory Usage is at 100%. I've searched the web but can't figure out this is good or bad. mixed

Can anyone shed some light on this?

Also, does this screenshot reveal any other problems?

I should also mention that we are using a virtual server with 4MB RAM and we are running 2 Moodle sites (version 2.4 and 2.5). 

Any feedback would be appreciated.

Thanks,

Fernando

Average of ratings: -
In reply to Fernando Oliveira

Re: OPcache: Memory Usage = 100% (is this good or bad?)

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hello,

Sorry i've no answer for you, but i suppose you mean your server has 4GB of RAM wink

In reply to Fernando Oliveira

Re: OPcache: Memory Usage = 100% (is this good or bad?)

by Andrea Bicciolo -
Hello Fernando,

looking at the screenshot provided I think you could probably increase the memory used by OPCache so you could cache more files, currently you have 'opcache.max_accelerated_files=4000' however most probably you reached almost 100% of cache consumption with less than 4000 files. You can check the number of currently cached file using the "File usage" button on the OPCache gui script, then you could try increasing OPCache memory of about 64MB and verify if your hit rate increases.
Average of ratings: Useful (3)
In reply to Andrea Bicciolo

Re: OPcache: Memory Usage = 100% (is this good or bad?)

by Pedro Martins De Torre -

What is that "OPCache gui script" that you referred to?

Where do I find this gui script in Moodle 2.7.2?

Thank you.

In reply to Fernando Oliveira

Re: OPcache: Memory Usage = 100% (is this good or bad?)

by David Scotson -
I'm just learning about this myself but... I think you're fine.

You ideally want to be using just under 100%. Any less and you're wasting memory that could by used by other things (assuming you've got it on the same machine as something else), any more and it'll start bumping things out of the cache.

It looks like you've just hit the bumping things out of the cache level, but memcached is smart enough to ditch the least useful things. For example I noticed that if you update your language strings then the cache will immediately get about 1000 new entries for each of the language files. But they're not used in the normal flow of use so you don't care of those 1000 get bumped out of the cache in favor of things that are hit more often.

Keep an eye on the hit rate. At first it'll be low since the first time any file gets fetched that counts as a miss, so it's entirely expected for there to be a few thousand misses as the cache warms up. But I'd expect it to move up to 99% if things are working okay and those initial misses get dwarfed by the later repeated hits.

Average of ratings: Useful (1)