Serendipity 0.9.1 performance

Discussion corner for Developers of Serendipity.
Post Reply
Guest

Serendipity 0.9.1 performance

Post by Guest »

Dear Serendipity Team,

I plan to release a news site and I evaluated many
CMSs. I found Serendipity to meet all my needs. I installed
it on a testing server (Windows 2000, Apache 2.0.14, PHP 5.1.1,
MySQL 5.0.15, Athlon XP 2600+, 512M RAM). Things went great
except for one : performance. Here are some things I found:

>> The server can deliver only about 50KB/s of content
- for 3 clients, 5 connections/client
- clients are on the local network with the server (100 MB/s)

>> Apache uses about 60-90% of CPU
- PHP installed as module not CGI
- Turning mod_rewrite on/off doesn't affect the performance

>> MySQL traffic is very high
- Serendipity creates high traffic to MySQL
- MySQL Admin shows between 300KB/s and 5MB/s

Some things that may be usefull:
- Active Sidebar Plugins : Quicksearch, Archives, Syndicate This Blog, Categories
- Active Event Plugins : Markup: NL2BR, Extended properties for entries
- Cached entries were buildt
- There are about 100 articles in 32 categories
- Articles have about 20 KB each
- Database tables were optimised before each test
- Apache, PHP and MySQL configs were tuned
- Theme used : Serendipity v2.3
- Serendipity version : 0.9.1

I estimate about 10000 to 50000 page views / day
for the site so current performance is not good. Please
let me know if there are any things that I can do to
improve it.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Serendipity 0.9.1 performance

Post by garvinhicking »

Since Serendipity is a blog all about dynamic performance, it is actually pretty hard to optimize all things.

As you'Ve figured, serendipity's performance very much relies on a server with enough RAM and a good MySQL/PHP configuration.

Your first try at optimizing is to get more RAM. 512MB for the amount of page hits you're aming is incredibly low.

You should also think about using a dedicated Linux machine, which performs much faster than windows Apaches.

Then you should optimize your MySQL server to give him very much RAM for the query optimization.

Then HDD performance is also important, so defragment your harddrives often and try to put the database on a HDD independent of your web-files.

As an absolute must, you should install a PHP Bytecode cache like Turck, Zend, PHPA or APC. This alone inreases performance noticable (on my machine, about 150%). I don't know though if it's available for windows machines.

As for tuning Serendipity, you should think about disabling the "Apply read-permissions for categories" option, if you don't absolutely need it.

Then think about if you can install the plugin "Simple Cache" (serendipity_event_cachesimple, available through spartacus). This should inrease your load-times also.

The last step is to think about using lighttpd as a webserver and the FastCGI PHP implementation.

Best regards,
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/
Guest

Thank you

Post by Guest »

Thank you for your tips.

I use Apache+MySQL for testing because that's what my webhost use. As from performance increase using Linux and optimizers - I need more than 150%.

Adding more memory will not help for testing because the database is only about 1MB. So I think there is no need for more memory.

The next step I plan to do is to strip down all the features I don't need directly from the template and make static pages for everithing I can (CSS for example). I am not an experienced PHP programmer but I know how to use Delete and copy&paste :)

Maybe I will post some benchmarks if I get good results.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Thank you

Post by garvinhicking »

Okay, but you should still serously think about tuning Apache+MySQL, there's a lot that can be done which is beyond the scope of this forums. Bytecode optimiziers can in cases give you much more than 150% increase. And Windows TCP/IP stack can/must be optimized for that high throughput.

Seriously think about the cachesimple plugin!

Another thing, I don't know if you already know this: Never run benchmark clients on the same machine as your server, they absolutely screw your results and double the network throughput and thus reduces actual performance a lot.

Stripping down features, making the templates lighter is also a think always worth doing. Static stylesheets is also a good idea, if you don'T need dynamic CSS.

Best regards,
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/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

What is meant by "static stylesheets"? I thought the style.css in each template was already static. What am I missing?
Guest

Post by Guest »

serendipity.css.php in the main directory
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Judebert: Right, current calls to the Stylesheet are all routed through serendipity.css.php. This is happening to be able to make plugins be able to inject CSS stylesheet code. And it of course then intializes the whole s9y framework, which costs a few extra performance bucks...

Best regards,
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/
jojje
Regular
Posts: 41
Joined: Thu Dec 08, 2005 4:09 pm
Location: Sweden
Contact:

Post by jojje »

garvinhicking wrote:Judebert: Right, current calls to the Stylesheet are all routed through serendipity.css.php. This is happening to be able to make plugins be able to inject CSS stylesheet code. And it of course then intializes the whole s9y framework, which costs a few extra performance bucks...

Best regards,
Garvin
I don´t know if I understand this but is it possible to put all my css styling in a css file and adress all stylesheet calls to this file instead of the serendipity.css.php?

I really need to spped up as much as I can.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Jojje: Yes, this is possible. But you need to pay attention that when you ever add new plugins that you need to check if those use/require additional CSS that you must put in your static CSS file.

Best regards,
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/
Post Reply