Alternative PHP Cache (APC) saves the day
Posted by Mikko at 5 February 2012
Category: BiliBid
During the peak hours of BiliBid last Friday night, I had to heavily monitor our servers since it was the first time that we’re expecting higher than usual loads since I changed the set-up of our servers. From the usual 2.50 to 3.00 on normal days, it spiked to as high as 25.00-level. The server was consuming more RAM than usual that it had to use the swap space (virtual RAM). Fortunately, the server was able to survive the night.
Right after all the auctions, I immediately searched for ways on how to reduce server load and RAM usage. I had to find a solution right away since we’re expecting a much higher load the following night.
The first thing I had in mind was to get another server on the same datacenter, then do a load-balancing between two web servers while maintaining a single database server for data consistency. Obviously, the trade-off would be the cost.
I was about to deploy another server when I read an forum post by someone who share the same problem with me. I read the entire thread and read a suggestion to use the Alternative PHP Cache (APC). The thread starter confirmed that APC lowered down his CPU usage so I thought of giving it a try, too.
Right after installation, I immediately saw a drastic drop on the load. I played with APC’s configuration for some time then restarted the server to free up some RAM in case I have memory leaks. After the restart, I saw promising figures, increasing my confidence on the server.
Then came Saturday night, the time I was expecting the heaviest load. During the time I had maximum number of requests on the server (even more than the max no of requests on Friday night), the load only played from 1.50 to 2.00, a huge leap from Friday night’s 25.00.
The server has officially survived the heaviest load (in terms of requests) for Saturday night without hiccups and with spare resources for moooore load. Thanks APC for saving the day!
Now, I have more time to optimize my UFC 143 live stream post. Hehehe.
======================================
Related posts:
- The art of scaling
- Trying to solve an upcoming problem
- A Small Orange Rocks
- The Geek Brewery is ONLINE plus DreamHost and A Small Orange Promo Code!
- Wala na po kayong load!