Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3
  • Apache/Wordpress Performance Tuning

    Yeah, it’s been a long time since I’ve written anything in this space. I did however recently move this site from the shared hosting provider I was using to a Ubuntu 8.04.2 LTS Xen instance. The plus of this is greater control. The downside is that I’m cheap, especially for a personal blog with no traffic, so we’re talking an instance with a whopping 256 MB of RAM here. So how to speed it up?

    The first thing I did was try to get a baseline using ApacheBench, which I ran after performing zero tuning. The result was utter disaster. Apache would spin off new processes until memory and CPU were completely consumed. System load spiked to over 40, and the benchmark failed to complete. Clearly the very first thing I needed to do was size Apache down for my limited system. So I made the following changes to apache2.conf: StartServers 1

        StartServers          1
        MinSpareServers       1
        MaxSpareServers      5
        MaxClients          5
        MaxRequestsPerChild   300

    Needless to say, that’s greatly reduced from the default. Obviously I can’t serve much traffic, but I hopefully won’t be allowing anyone to DoS my server. This time, ApacheBench completed fine:

    Server Software:        Apache/2.2.8
    Server Hostname:        platospharmacy.org
    Server Port:            80
    Document Path:          /
    Document Length:        54931 bytes
    Concurrency Level:      25
    Time taken for tests:   500.377 seconds
    Complete requests:      2212
    Failed requests:        240
    (Connect: 0, Receive: 0, Length: 240, Exceptions: 0)
    Write errors:           0
    Total transferred:      122194793 bytes
    HTML transferred:       121592041 bytes
    Requests per second:    4.42 [#/sec] (mean)
    Time per request:       5655.252 [ms] (mean)
    Time per request:       226.210 [ms] (mean, across all concurrent requests)
    Transfer rate:          238.48 [Kbytes/sec] received

    Connection Times (ms)
    min  mean[+/-sd] median   max
    Connect:       29   48 169.3     34    3049
    Processing:  1108 5564 2041.5   4791   27755
    Waiting:      845 5072 1812.4   4381   14593
    Total:       1140 5612 2056.2   4830   27789

    Obviously not amazing. I’m coming nowhere close to the potential of my uplink, I’m getting a pathetic amount of reqs/sec, and far too many failed requests. This needs to be improved. So I installed the WP SuperCache plugin and configured it for full cacheing:

    Server Software:        Apache/2.2.8
    Server Hostname:        platospharmacy.org
    Server Port:            80

    Document Path:          /
    Document Length:        54968 bytes

    Concurrency Level:      25
    Time taken for tests:   500.007 seconds
    Complete requests:      6850
    Failed requests:        6845
    (Connect: 0, Receive: 0, Length: 6845, Exceptions: 0)
    Write errors:           0
    Total transferred:      379514426 bytes
    HTML transferred:       376800780 bytes
    Requests per second:    13.70 [#/sec] (mean)
    Time per request:       1824.844 [ms] (mean)
    Time per request:       72.994 [ms] (mean, across all concurrent requests)
    Transfer rate:          741.23 [Kbytes/sec] received

    Connection Times (ms)
    min  mean[+/-sd] median   max
    Connect:       29   39  63.3     37    3055
    Processing:   869 1782 163.8   1748    3021
    Waiting:      684 1471 150.7   1436    2752
    Total:        908 1821 176.0   1786    5497

    This is clearly a big improvement in raw performance, but look at all those failed requests. This of course still is not going to cut it. The next step was to install Alternative PHP Cache. Signifigantly reducuing PHP compiles should show some big improvement. I went with APC over the alternatives because it’s due to be included by default in PHP 6.

    Server Software:        Apache/2.2.8
    Server Hostname:        platospharmacy.org
    Server Port:            80

    Document Path:          /
    Document Length:        56024 bytes

    Concurrency Level:      25
    Time taken for tests:   500.015 seconds
    Complete requests:      5797
    Failed requests:        4
    (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)
    Write errors:           0
    Total transferred:      327170478 bytes
    HTML transferred:       324873720 bytes
    Requests per second:    11.59 [#/sec] (mean)
    Time per request:       2156.352 [ms] (mean)
    Time per request:       86.254 [ms] (mean, across all concurrent requests)
    Transfer rate:          638.99 [Kbytes/sec] received

    Connection Times (ms)
    min  mean[+/-sd] median   max
    Connect:       29   43 125.3     36    3051
    Processing:  1568 2108 619.6   1971   10332
    Waiting:     1266 1730 537.8   1611    8680
    Total:       1603 2152 639.1   2007   10366

    Now this is more like it. While technically performance actually dropped a bit, failed requests are almost gone. This is about the best I can hope for on my small server. Ok, there’s always MySQL tuning, but from Apache, PHP, and Wordpress I’m quite happy with these results.

    Monday, May 25th, 2009 at 15:59
    Comments Off
  • Current Blogs

    Using my Tumblr account as a personal blog.

    Doing some group blogging here.

    This site currents serves as an archive.

    Sunday, December 21st, 2008 at 17:43
    Comments Off
  • Colts Wild Card Watch – Week 16

    Let’s hit this up fast. The Colts are now 10-4, the 3rd best record in the AFC. They are one win away from locking up the #5 seed, which could come as soon as their game against the Jags on Thursday. In the event the Colts lose the last two, they can still get a playoff spot through help in the following ways:

    • One Ravens loss (gives the Colts the #5 seed still)
    • One Pats loss (#6)
    • One loss by both Jets and Dolphins (#6)

    Thanks again to Stampede Blue. For my money, I expect the Colts to put away the #5 on Thursday.

    Monday, December 15th, 2008 at 13:59
    Comments Off
  • Bloggity

    Even though I just got this site set up, looks like I’ll be doing some blogging over here too. Not yet sure how I’ll decide what to post where, but I’m quite sure a group blog will be more frequently updated than anything I try to do myself. :-)

    Wednesday, December 10th, 2008 at 12:03
    Comments Off
  • Colts Wild Card Watch – Week 15

    So I skipped this last week. Sue me. :-)

    • Colts, 9-4
    • Ravens, 9-4
    • Jets, Dolphins, Pats, 8-5 (Note: One of these teams will win the AFC East and thus not take a wild card spot)

    Pretty easy at this point honestly. The Colts control their own destiny and are very close to clinching. Stampede Blue explains:

    1 Colts win + 1 Pats loss
    or
    1 Colts win + 2 Ravens losses
    or
    2 Colts wins
    or
    2 losses by any 2 of Jets, Pats, Fins

    Like I said, easy. You have to assume the Colts will beat the Lions, so we just need them to also beat the Jags, making the Titans game and what other teams do irrelevant. In case they drop both those two, the Pats won’t lose this week against the Raiders, but both the Cards (especially) and Bills are loseable games for them. The Jets and Dolphins also have chances to lose, and we’re helped by the fact they play each other the last game of the seaon. So there’s plenty of contigencies. Basically we Colts fans are cheering against the Ravens and/or the AFC East.

    Tuesday, December 9th, 2008 at 18:15
    Comments Off
  • Commercialism vs. Art

    Via Jason’s Google Reader shared items feed, I learn of this travesty:

    We’ve already told you about the Watchmen video game, but little did we know that that cynical cash-in was only the start. May I interest you in the Watchmen Cell Phone Game?

    Glu Mobile – who are already working with Warner Bros to create mobile games based on Superman, Bugs Bunny and The Dark Knight – announced earlier this week their plans to create a game based on Alan Moore and Dave Gibbons’ groundbreaking 1980s series – or, more truthfully, based on Zack Snyder’s movie adaptation of Alan Moore and Dave Gibbons’ groundbreaking 1980s series.

    Is it just me, or is sci-fi/fantasy treated with a certain level of disrepect that other genres are not? Watchmen made Time Magazine’s list of the 100 best English-language novels from 1923 to the present, and just wait, there will eventually be a toy line now. In fact, what other two books on that list already have toy lines? Why The Lion, the Witch, and the Wardrobe and Lord of the Rings of course! So I wonder, what if books from other genres were treated this way? New from Mattel, it’s the 1984 Room 101 Action Playset! And who wouldn’t collect cereal box tops to send away for a Big Brother action figure? Sticking with Orwell, Animal Farm seems like a natural for a toy line, kids can re-create the exile of Snowball. A friend of mine weighs in with more suggestions over IM:

    But I’m sure the accessories to the Schindler’s List Action Figures would be awesome.

    You can go in all kinds of wrong and immoral directions with this idea.
    Ibsen’s Dollhouse
    Or better yet, Nabokov’s dollhouse

    The Gravity’s Rainbow Erector Set is sure to be a top seller.
    The video game tie-in for Cormac McCarthy’s novels could be pretty cool, what with the senseless graphic violence and all, except the game always conspires to prevent you from winning.
    OK, I’ll stop now.
    I tend to be better at concept than execution on ideas like this, so leave your own suggestions in the comments. :-)

    Friday, December 5th, 2008 at 15:08
  • Colts Wild Card Watch – Week 13

    I’m about to go on vacation to NYC for a week, so let’s get this done now:

    • Colts, 7-4
    • Ravens, 7-4
    • Pats, 7-4
    • Dolphins, 6-5
    • Bills, 6-5
    • Browns, Jags, Texans, Chargers, all 4-7

    Things continue to look good for the Colts. Locked-in tiebreakers over the Ravens & Pats leave them in complete control of the #5 seed. The biggest potential threat, the Dolphins, took a loss, and the Jets beating the Titans mean that the Jets are more likely to win the AFC East and not affect the Colts, and means the Titans are only three games up on the Colts, keeping a dark horse shot at the AFC South alive. The Colts take on the Browns in Cleveland on Sunday; here’s other games involving playoff competitors (I’m not going to concern myself with the 4-7 teams, if they can close the gap, we’ll revisit this):

    Titans@Lions: The Colts would love to keep their chances at winning the AFC South alive, so this is an easy one.

    49ers@Bills: As always, AFC vs. NFC matchups are obvious.

    Ravens@Bengals: The Ravens are a legit competitor, the Bengals are not.

    Dolphins@Rams: AFC vs. NFC rule.

    Steelers@Pats: Lets keep the Steelers out of the way and atop the AFC North even if we do have the tiebreaker over them.

    Broncos@Jets: Both teams lead their division, and any time a division leader can lose and get back into the mix for the wild card, Colts fans should notice. I’m going with the Jets because they can less easily afford a loss and keep their division lead right now.

    That’s it for now, everyone enjoy Thanksgiving and football.

    Monday, November 24th, 2008 at 14:42
    Comments Off
  • Colts Wild Card Watch – Week 12

    As of today, the standings are now:

    • Colts, 6-4
    • Ravens, 6-4
    • Dolphins, 6-4
    • Patriots, 6-4
    • Bills, 5-5
    • Chargers, 4-6
    • Browns, 4-6
    • Jags, 4-6

    Looking good. The Colts have locked-in tiebreakers against both the Ravens and the Pats via head-to-head wins. Miami is tenuous, as the Colts only have a half-game on them due to AFC record, 5-2 vs. 5-3. The Bills could still be an issue if they can somehow turn it around. The Colts play all the 4-6 teams, of which the Jags are most dangerous, as a Jags win would lock in a tiebreaker over the Colts. Next, let’s take a look at this week’s games, again comparing to Stampede Blue.

    Bengals@Steelers: Naturally. The Bengals are no threat, while the Steelers still could be. Of course, we already know the outcome of this game. (Also, does everyone else laugh when reading articles that reference “Ocho Cinco”?)

    Eagles@Ravens: Again, naturally.

    Vikings@Jags: Yet another easy call.

    Bills@Chiefs: And again I find myself in agreement. The Chiefs are done, while the Bills are still in the race.

    Pats@Dolphins: As much as I hate cheering for the Pats to win anything, the Dolphins are arguably the biggest threat right now.

    Jets@Titans: If the Jets keep winning, they stay safely atop the AFC East and not a threat. While the Titans losing enough to give the Colts a shot at the AFC South is not very likely, it’s not impossible either.

    Texans@Browns: Same logic again. Texans are likely done, while the Browns could beat the Colts a week from Sunday.

    Raiders@Broncos: I’m going to bet on the Colts beating the Chargers, which you sort of have to when you’re trying to get your team a wild card spot. If the Colts do lose, I’m not sure the SB scenario of the Chargers pulling ahead of Denver in the race is all that realistic, but there is logic in hoping for it.

    Friday, November 21st, 2008 at 10:27
    Comments Off
  • The Motorist

    From Suburban Nation: The Rise of Sprawl and the Decline of the American Dream:

    In the suburbs, time normally spent in the physical public realm is now spent in the automobile, which is a private space as well as a potentially sociopathic device. The average American, when placed behind the wheel of a car, ceases to be a citizen and becomes instead a motorist. As a motorist, you cannot get to know your your neighbor, because the prevailing relationship is competitive. You are competing for asphalt, and if you so much as hesitate or make a wrong move, your neighbor immediately punishes you, by honking the horn, taking your space, running into you, or committing some other antisocial act, the most egregious of which have been well documented. Like drinking, driving has become a well-worn excuse for all sorts of rudeness and aggression – “It couldn’t be helped; he cut me off.” The social contract is voided. Why this is so is worthy of further study. Suffice to say that only rarely do two pedestrians gesture violently at each other as they pass.

    When I read the passage, I couldn’t help but think of this:

    Friday, November 14th, 2008 at 19:39
    Comments Off
  • Armistice/Veteran’s Day

    I’m reminded (of all things) of the closing lines from Blackadder Goes Forth:

    Well, I am afraid it will have to wait. Whatever it was, I am sure it was better than my plan to get out of this by pretending to be mad. I mean, who would have noticed another madman around here? Good luck, everyone.

    In honor of all who died because of ridiculous leaders causing pointless wars throughout history.

    Tuesday, November 11th, 2008 at 11:42
    Comments Off
TOP