Serendipity and Performance Questions

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Jon Murray
Posts: 2
Joined: Sun Oct 21, 2007 9:14 pm
Contact:

Serendipity and Performance Questions

Post by Jon Murray »

Hello everyone, ready for my brain dump and questions?

I've been using Serendipity for about the last year or so on about 15 different sites. I have one site (www.ufcresultslive.com) which gets extremely high traffic once a month during that month's UFC event. When my blog was on shared hosting response was always not too bad, but recently I've moved to a dedicated hosting box (3.0 Ghz P4 with 2GB ram). The box is running CentOS4, Apache 2.052, PPH 4.39 and MySQL 4.1.

I expected that I would have much better performance at crunch time being that I'm the only user on the box, but that just hasn't been the case. Last night my server was swamped (linux showing 270 processes and 100% cpu) (meaning about 180 of those were httpd). The problem is of course that the content is being served dynamically and killing me on memory, cpu and db access. I turned on query caching in mysql and that seems to have helped a bit, but I am wondering?

Does anyone have any general or specific hints on optimizing your linux environment for Serendipity?

I've also tried turning on mod_cache in apache, unfortunately the crunch is over so I can't tell if there is a difference, it doesn't seem like each process is using less memory or cpu time to me though. Reading several sources seems to indicate that mod_cache wasn't really stable/production ready until apache 2.2, so I'm not sure if I'm wasting my time using it in 2.052.

I'm not really much of a linux admin (I can make my way around alright, but doing things like upgrading apache on a live site makes me a bit nervous). I do have a test box here at home running in a virtual machine that I will play around with upgrading to apache 2.2, but in the mean time I'd love to hear some things that have helped other people out.

I also assume that this is not a specific Serendipity problem, I'm sure any php/mysql content engine would have the same issues, unless they had some sort of time based page caching built in.

Notes:
1) I'm not running the stats plug in
2) I've gotten rid of the extended properties plug in (after last night)
3) I'm not getting spammed...this was real traffic last night (lucky me).

So, last night I did about 20,000 visitors, but if my site wasn't so unresponsive I'm sure I would have had 50,000 or more. I was thinking about maybe doing a static version of my site and swapping that in the day of the UFC events, but that seems like overkill. There should be some way to do page caching such that the server is only checking for dynamic content at specific pre-defined intervals (say 10 minutes). Meaning one mysql or php access during that 10 minutes and the rest of the time it's static pages based on the url requested. The logical place for that to occur is in apache or some web server front end proxy. I think I've configured that, but can't tell if it's helping or not (not confident due to the 2.0x version of apache I'm running).

I tried the experimental cache plug in for serendipity, but I can't tell if it's helping or not and unfortunately I won't see real traffic like that for another month.

Help? Advice? Similar experiences?
chickens
Regular
Posts: 192
Joined: Wed Dec 06, 2006 12:15 am
Location: Vegas
Contact:

Post by chickens »

Have you optimized your httpd.conf and my.cnf files? Quite often either apache or mysql is the root cause of the problem. There are tons of tutorials out there for configuring each of these to work to the best of their abilities for your hardware. If you would like to post them here I would be more than happy to take a look at them.

I would suggest moving to php5 as there are quite a few performance settings that should help there. If you do go that route you should also upgrade apache and mysql to the latest versions. You should see some performance increase just with the latest versions.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Make sure to install a PHP opcode bytecache like "APC". This hugely speeds up PHP applications, also serendipity.

What chickens wrote is true, too. You need to make sure you don't hit the "spiral of death". You need very good caluclations of how many apache childs, connections and memory it is allowed to use. Make sure, a lot of your RAM is used for MySQL (quqry cache). Sadly this tuning means are a bit beyond the scope of this forum - I'd suggest reading a book like "High performance MySQL", this also covers some basic Apache instructions.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Jon Murray
Posts: 2
Joined: Sun Oct 21, 2007 9:14 pm
Contact:

Post by Jon Murray »

Thanks guys. Looking through those performance tutorials is kind of like looking for a needle in a haystack. Trust me, I've done nothing else today but look at different sites for optimizing apache, mysql and php. I was wondering if the PHP optimizers would help much, thanks for the confirmation. Also, I believe that upgrading mysql, apache and php will probably be my biggest boost (I'm afraid to do it, but I guess I'll have to).

I'm sorry Garvin if this isn't exactly the right topic for this forum, but I've been helped here before and I know there are a ton of people here knowledgeable with those apps and specifically their interaction with a blog engine like Seredipity. For instance there are tons of tutorials on speeding up access to static pages...clearly not what I need. I guess I was just looking for some confirmation that I was going down the right path...or a magic bullet would have been nice too :-)

I'm going to start by upgrading apache, php and mysql and then see what kind of gains I get.

chickens, thanks for the offer of looking through my files. I'll do my upgrades first and see how it behaves...then maybe I'll take you up on your offer.

Thanks again guys!

Jon
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Whilst this forum may not be the 'best' place for you to get your answer, it's actually been interesting to read about your problem and see the replies. I for one think this forum needs users like you who are prepared to give us an insight into the technical side of setting up a server. Thanks, Carl
Post Reply