PHP Accelerator – Cache Size Issues

In this email to the ILUG Webdev list I pondered the effect of deleting the cache used by PHP Accelerator on our Apache webserver.

In my ramblings on my blog I (very?) occasionally post something useful.
We use PHP Accelerator( http://www.php-accelerator.co.uk/index.php ) at work and last week I played around with tuning our webserver: link

We saw a dramatic increase in traffic but I wasn’t sure which of the ideas I tried had affected our server so much!
Yesterday I deleted the PHP Accelerator cached files, and lo and behold, we hit another spike in traffic!

“Remember I did some tuning of our server at work? Well, traffic has returned to normal again, but I was told this is a quiet time in the futures market right now. As an exercise I deleted the php Accelerator cached files again and I am seeing another big jump in requests served!
It might pay to remove those files on a daily basis!”

I setup a cron job to remove the phpa files in the morning and if I see the same level of traffic today I may set it up to delete the cached files on an hourly basis tomorrow. I expect the traffic to the site to be slightly less today than yesterday simply because the cached files were deleted much earlier on in the day (4am) so by the time our server gets busy there’ll be a larger cache.

And, shock, horror, I might even try it without the cache at all!

Donncha.

ILUG Web Development
http://mail.linux.ie/mailman/listinfo/webdev/

Well, I can confidently say that deleting the cache does improve performance. In further discussion with Kae on the issue I guessed that:

  • All php files are being cached, probably using the URL of the request as a key to the cached file. This isn’t useful in a very dynamic site.
  • The cache directories can become very large with many thousands of files in one directory. That makes it much harder for the operating system to scan through the file list. Different filesystems handle this better than others.
  • Once the cache is deleted, filename traversal of the cache is faster and core include files are quickly cached again.

It’s worth using the cache despite the obvious cache problems as it makes Smarty templates much faster and we have a lot of shared code that benefits from the caching.
I’m deleting the cache every hour now and expect to see a marked improvement in the web server logs and adviews!

Misc Photograph Links

Several articles and sites, found by me, and (most of them) by Mark. With or without silly comments from me. (yes, yes, shut up! give us the links will ya!)

Proposed ban on photography on New York City Transit – Articles have been doing the rounds about this ban. I should probably post my one or two photos I took on the New York MTA last August. There’s a couple I like out of the bunch!
Blur to reduce size? – I dunno, it’s not a technique you should use simply to get smaller image sizes but it could be handy. Plenty of other speed tweaks on that site too for website writers.
Do you like beautiful photos? I do. I don’t pretend to be amazingly good at it or whatever but I like what I like. So does Mike Johnston in his latest article. No doubt he’d have a few words to say about my photos! Read the article, he has a lot to share!
I wouldn’t mind reviewing several cameras if I could travel to China and do so! Actually, i’d love to do either of the above so if anyone wants to send me to China leave me a comment below! heh.
What’s Next for Digital Photography? – ooh, I like the idea of putting several CCDs into a camera!
I hadn’t come across Outdoor Eyes before. Looks good! Good info on selling and getting your photos displayed!
Several tips on composition here. I might even get around to reading some of the stuff linked here!
Photo links has some great tips linked to from their site!

The Sunday Times – Online

Colm on pointed at an article I had previously read in the Sunday Times which had reminded me of my own unfortunate troubles with the US immigration just over a year ago.
That reminded me that I should look for the Sunday Times website which I did, and it redirects to the most recent edition. Great reading there, especially their D-Day coverage.
Here’s the article about that Brother Columbanus I mentioned yesterday. (Unfortunately you have to register to view that content!)

One of those weekends.. and other stuff!

It was one of those weekends for a lot of Irish people I think. Certainly, I was completely out of the loop news wise! I didn’t even know Ronald Reagan had died until I read Mark’s blog yesterday morning! Via Kevin, some don’t have anything good to say about him, and I’ve certainly heard a lot of negatives about him.

I can’t help but remember the British comedy, Spitting Image and their puppets and Ronnie trying to decide, “what’ll I have for breakfast?” mistaking the American nuclear missile launch codes for his breakfast menu.. heh.
RIP.

Wouldn’t you know it? On the day that Venus transits the Sun, others capture remarkable photos but it’s overcast here in Cork!
Hmm, and via Pixelbeat (who’s obviously a Window Maker fan!) comes this article on the Witty Worm. It’s kinda cool, as it fits inside one UDP packet!
Remember I did some tuning of our server at work? Well, traffic has returned to normal again, but I was told this is a quiet time in the futures market right now. As an exercise I deleted the php Accelerator cached files again and I am seeing another big jump in requests served! It might pay to remove those files on a daily basis!
I hope No-Action Jackson works in Wine! Looks kinda cute!
And if you want to download the trailer to Fahrenheit 9/11 (that guy in the last photo doesn’t look very “secret” to me does he?) you could try the following:

mencoder -o f911.wmv -oac copy -ovc copy mms://wm.mindshare.na-central.speedera.net/wm.mindshare.\
na-central/moore/fahrenheit_911_480.wmv

You need mplayer installed, but that’s as easy as apt-get install mplayer 🙂

Excellent! Another issue of The Digital Journalist is out. They promise a tribute to Ronald Reagan next month, that should be good, judging by their previous efforts. Just after browsing their TOC and looks like they have a few articles on D-Day.
I watched the BBC coverage of the commemeration on Sunday night and it was really well done. I even saw Brother Columbanus, an Irishman, dressed in his monk’s garb, salute and smile at the Queen as he marched past the viewing stand! (He was mentioned in an article in the Sunday Times, he took part in D-Day, and after the war returned to Ireland and became a brother in a monastory!)

Spiders, spiders.. everywhere!

Sitting down to read the Sunday Times yesterday what crawls out from underneath the paper? *shudder* Any sane person would get something to either trap or kill the spider but I grabbed my camera and snapped a few photos!
FWIW, when I was finished I trapped the spider and released it into the garden. It’s bad luck to kill a spider isn’t it?