Realizing once again I haven’t written a blog post for quite some time, I thought I would just write a few smaller posts on things I’ve learned these last few months. Hopefully I can get back into the habit of blogging regularly again.
This last month I finally broke down and learned how to use memcached. While I have known about memcached for a very long time, I just never got around to using it. While I heard it was beyond easy to implement, I still assumed it would take a few days to get the hang of it and figure out its quirks. However, when the forces of high load on a webserver and the file-based caching system that I have previously used were found to be too I/O intensive, I had no choice but to take the plunge.
It took me about 4 hours to add memcached support to my caching class and to be up and running at blazing speeds. That was from the very start to finish. That included reading the documentation and installing memcached on our Ubuntu server. Not only was is very easy and straight forward, but it was extremely effective.
There have been technologies that once I’ve learned I never want to go back to the “old way.” Subversion, jQuery, XAMPP, and xDebug are a few of these. I am now adding memcached to that list. It is so simple and straight forward. There are no complex configuration files or loads of manuals to read. You basically pass it the parameters of the size of the cache, what IP to listen on, and what port to use. That is it, nothing more. Then, in your PHP code, you just pass the memcache class the server’s info and you’re done.
One useful script I found was for a memcached monitor. It allows for you to view the stats and easily flush your memcache instance. Here is a snap shot from this script on our memcached instance:
It gets up to 900 requests per second during peak times. It was amazing to this that before we had about 900 requests a second trying to read from our hard drive. This is so much more efficient.
If you’ve hesitated working with memcached, don’t! It is an amazing simple yet powerful tool. It can help any website. Maybe my next blog post will be on how we’ve made such an effective cache at 99.9%.
Related Posts
- SoapUI – a simple and raw Java SOAP Client There are times when you need a “raw” SOAP client to see the exact messages being sent to and from a Soap Sever. This is especially important for developers who are hosting a soap server for an API. In my example, PHP was throwing an error, but I couldn’t see...
- ASP .NET Ajax – Straight forward and simple, the way it should be. I have to say, I’m very impressed with the implementation of ASP .NET AJAX. After creating several projects in .NET, converting several of my pages to implement AJAX was beyond easy. It was incredible. It takes all the “thinking” out of AJAX and just makes it work. Now, I’m not...
- PHP Singletons, Sub-Classing, and HAS-A Relationships I’ve been very busy these last fews weeks and have neglected making any posts. While there are a variety of subjects I’d love to post about, they’ll most likely have to wait until the next year. However, I thought I might be able to throw up a quick example of...
- PHP Design – Biggest Database Oversights Over the last three years I’ve had the opportunity to work on several PHP projects, some of them having grown rapidly and required to scale quickly. Three in particular have been a fantastic learning experience for me. Now I don’t consider myself a total expert, but I thought I would...
- MS SQL 2005 (T-SQL) Row Count for Each Table At work I needed a solution to give me a count of how many rows each table contained. I’ve always liked phpMyAdmin’s ability to list all the tables and show their size and row count. I’ve found it immensely helpful. However, I couldn’t find anything similar for SQL Server Manager...
