peak

How To Host Slashdot On a Shared Server

By: Jon Gales

This week’s PowerUser Monday is brought to you by Scott Kelby’s Macintosh

The Naked Truth. Read MacMerc’s review of it here.

If you have a story suggestion, please email it to jon@macmerc.com.

Last week I covered the WWDC Keynote speech live (from the satellite feed

shown at the Tampa

Apple Store). If you missed it and live in a cave, here’s

the archive.

Like all of our live events it was a complete blast–we had tons of people

chatting

in

AIM/iChat

and served

an

amazing

amount

of pages

to enough people to sell out a basketball arena. The most amazing part

of all is that MacMerc is completely housed on a single shared server from

the fine folks at ActaDivina.

spike How To Host Slashdot On a Shared ServerI

could go on and on, but pictures are better than words. Seen at right what Webalizer made

of our traffic spike. The bright blue bar is pages (the main focus of this

article). That spike is pretty impressive… It’s roughly 20 times above our

average. So, what’s the secret to being able to handle the load? Static pages

baby.

Most of the cool features on MacMerc are made possible because of the

cool technology behind it. On any given news article you can comment, moderate

other

comments,

and

sometimes even vote in a poll. On stories like this one you see "blocks"

on the right hand side that give you access to some cool stuff. If you’re a

member (it’s free), you can even see how many people are currently at the site.

On any given page

load, we have server-side code that talks to our database and fetches the

data, formats it, and then exports it off to your browser. It’s all pretty

neat, but

it takes a lot of power to run. I made the decision a long time ago (right

after our server crashed during the iTunes Music Store announcement I believe)

that we would never try live coverage again without going static.

I wrote a

special content management system just for the keynote coverage. It

has a

pretty

slick

interface

and makes a static page as output. It’s also a time saver because it writes

all the time stamps and mark up for me. I just plug and chug. This was the

only scripting going on for the whole site, and only I was using it.

What’s the difference

between static and dynamic? When you accessed us during the keynote

the database

was

completely

still… No server

side programming

happened. Your browser said, "Give me the index page" and our server

said,

"here it is".

To take it a step further, I used mod_rewrite to forward everyone but myself

to the static index page. So if you typed in:

http://www.macmerc.com/ilovedellsomuch

You would see the same exact thing as everyone else. This is so we can assure

that the server is JUST working on shoving out the index page. The only person

that wasn’t seeing this page was me because I was doing the play-by-play.

So how did we do? Well here are some numbers/facts:

  • At our peak we were serving 150,000 pages an hour
  • That peak works out to about 40 pages a second (you should see this fly

    by on the terminal… really something).

  • With almost 500,000 pages served, we only went through about 5 gigs of

    bandwidth (the page was REALLY optimized). Not having any images really helped

    things move smoothly.

  • We still almost got nuked. The highest load average (via top in the terminal)

    I’ve ever seen happened during our peak… Over 100.

  • For a few hours we made Slashdot look

    like a Geocities page. Felt quite good. I felt tempted to try and crash someone’s

    site… Start a tradition of being "Merc’d".

If you’re looking for a host that can handle peaks, check out ActaDivina (nope,

we don’t get anything if you sign up… we just like them). They were superb.

They noticed the peak and streamlined Apache to make things

a little more smooth. Didn’t even have to ask them. If you got any questions

(or suggestions, we are going to be doing this again the

next

time

there is

a similar

event)

please let

me know. If you’re going to be having a similar event and want to find

out more about the content management system that I wrote, feel free to ask.

Safety First

Secure your Mac from new virus threats and protect your user account and files with these free downloads.

mu Safety FirstMisMatch

Defend yourself against the MAC.Amphimix/MP3Virus.Gen/MAC_MP3CONCEPT.A virus with this free utility. MisMatch scans a file or folder of files for resource fork mismatches and either quarantines or trashed suspect files.

mu Safety FirstTCstripper

TCstripper is pretty much the same thing, with a more exciting name.

mu Safety FirstDavtri HTTP Fingerprinting

Sometimes the best defense is a good offence. This app lets you peak into any given web server and returns info about it. Find out OS and web server they are using. Iím not sure what reason, beyond curiosity, you’d want to do it. But you can!

mu Safety FirstRPG

Generate random passwords for increased security with this simple little program. RPG allows you to specify limitation like character limits and punctuation.

mu Safety FirstLockPopCM

Protect a file from accidental deletion with a control-click. This Contextual Menu plug-in locks and unlocks files.

Now you can rest easier, knowing your files are safe.

Brian

mu Safety FirstDownloads provided by MacUpdate

Stream video, music, and photos to your Xbox 360 over your network

mini windows 20080416 212157 Stream video, music, and photos to your Xbox 360 over your network

Cynical Peak Software has released Rivet 1.0, their application for streaming video, music, and photos from Mac OS X to an Xbox 360 and, thus, your TV and/or home theater.

Rivet enables you to browse and view your entire collection of digital media from from anywhere in the house on an Xbox 360. Your Mac’s folder structure and organization is completely reproduced to allow you to quickly find exactly what you want to view.

Rivet 1.0 sells for USD$18.95.

Note: