the cost of optimization 2

Posted by paul on January 31, 2004

So between using MTOptimizeHTML and mod_gzip, my server is taking a beating.

red-load-day

last pid: 17424; load averages: 3.96, 2.94, 1.84 up 9+08:17:32 21:19:44
93 processes: 5 running, 88 sleeping
CPU states: 99.2% user, 0.0% nice, 0.0% system, 0.8% interrupt, 0.0% idle
Mem: 168M Active, 17M Inact, 41M Wired, 10M Cache, 35M Buf, 12M Free
Swap: 1027M Total, 440M Used, 587M Free, 42% Inuse

PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
11208 www 62 0 301M 44564K RUN 13:08 24.07% 24.07% httpd
11134 www 62 0 85152K 12724K RUN 5:57 24.07% 24.07% httpd
16618 www 63 0 83352K 49232K RUN 1:13 23.78% 23.78% httpd
17038 www 62 0 82584K 44184K RUN 1:55 23.63% 23.63% httpd
335 mysql 2 0 29320K 376K poll 28:02 0.00% 0.00% mysqld

The top 5 processes are chewing all my CPU time and for long periods of time (see the graphic: the red line is at 100% of CPU and ideally, utilization doesn’t exceed that).

The load average, as displayed by uptime(1), is over 5 now: that’s 4 too many. As you can see, it’s all httpd processes (Apache with an embedded mod_perl interpreter). The mysql process is dormant, for all intents and purposes.

I have to make the call here on how much I want to pay for optimization and what kind makes the most sense. mod_gzip seems like a very elegant solution and the load is distributed over the full day, while the MTOptimizeHTML hit takes place at every rebuild, ie, every post or comment.

Trackbacks

Trackbacks are closed.

Comments

Comments are closed.

  1. Frank Feb 01, 2004 13:31

    Paul, for those of us not paying close enough attention, what kind of hardware is seeing this load? With how much memory?

    Is the pipe a standard DSL, cable modem, or other?

    And, I remember that this box is FreeBSD, but what version?

    I’ve considered some of these steps myself, but first I think I’m going to upgrade my box to the Athlon-700 from the existing K6-2 450, which I’m thinking will become a FreeBSD tinker box. I’m curious, though, as to how much thrashing these guys generate.

  2. paul Feb 01, 2004 14:28

    Hmm, I can’t expect you to know all that, can I?

    It’s a white box AMD K7 box with a 700 MHz Athlon, 512 MB RAM. It’s running FreeBSD 4.9-RELEASE, built on Dec 21.

    MT is definitely an issue here: I thought I had resolved this when I switched from the Berkeley DB system to MySQL, but MySQL is plenty responsive while the combination of Apache and MT running in a mod_perl environment is thrashy. at some point last night, there was a shortage of swap space (again, MT at work) which is frustrating: there is a Gb of swap set aside. I logged it it here: http://www.paulbeard.org/movabletype/images/red-mem-day.png The big blue dip is a problem.

    I am on a cable modem connection, through Comcast, about whom I have no complaints.

    I have been hearing some talk from MT users going to Wordpress: I think Six Apart have some work to do that could push the release of 3.0 back. The comment and trackback spam problems and these performance issues (there are threads on their message boards that cover it) might turn people away from the next release, unless they can assure us they’ve addressed them.

    Right now, we have an open architecture (lots o’ plugins) but you daren’t use some of them because the impact on performance. For example, MTOptimizeHTML is a great idea but it’s way too expensive. Why isn’t something like that built in?

    Let me know when you start looking at FreeBSD. Perhaps this will goad me to look at 5.x, finally.