Chell Opcache block added

Just recently I was looking around what else I could add to the server setup that would be useful.

I decided to give webmin another try and was digging around a bit on the plugin side of things. I found one that displays details for Opcache. Looking at the github repository, I found a piece of hacked together PHP, that was used by this plugin.

Opcache

PHP is a scripting or interpreted language. That means that when you hit a PHP page, it will parse the code right there and then, and create what is known as opcode.

Opcode is an optimized form of your php code that can be run quicker by the PHP runtime. It’s a smart way of dealing with interpreted languages and you can see similar constructs in other languages. One that comes to mind is the Java variant that’s used for Android programming (although I’m pretty unfamiliar with the inner workings of Android programming).

What Opcache does is to cache the opcode that’s been generated for a specific page. So with Opcache enabled, when you call a PHP page, the PHP interpreter can skip the generation of opcode and just retrieve it from cache.

Chell

So what has Chell to do with all of this you might ask? Well as I said at the start of this post, I found code to display some statistics about what Opcache is doing.

The code displays metrics such as cache hits, misses or the number of files cached.

Since I really didn’t like the code style and general vagueness (which is a bit inherent to the PHP community imho), I rewrote the codebase and integrated it into Chell as a dashboard block.

It’s partly there and can already be found on my github, but still needs some work.

While doing this I decided I need to refractor the way Chell is saving it’s settings, but that’s a story for another post.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *