Apache configuration

Hi,

Recently I was advised to setup apache like this:

StartServers 10

MinSpareServers 10

MaxSpareServers 15

MaxClients 150

MaxRequestsPerChild 1000

I was running with this configurations:

StartServers 5

MinSpareServers 5

MaxSpareServers 10

MaxClients 100

MaxRequestsPerChild 500

Note that I'm in a 360 linode using ubuntu 8.10.

Why are the real differences?

Thanks

n

5 Replies

The configuration above will make Apache spawn 5 more processes, serve 50 more clients at the same time, and keep each process running for twice as long as before.

In other words, you'll be able to serve more simultaneous users, but you'll also use quite a bit more RAM. But do you really expect to serve 150 simultaneous users with Apache on a Linode 360? (That would be 43K unique visitors a day, if each visitor stayed on your site for 5 minutes on average.)

Figure out how much RAM you're using under peak load, and if it's too much, go back to the old config. Otherwise you won't notice a big difference unless you get dugg or slashdotted.

My problem is that swap was rising and committed memory is almost twice.

I switch back to my old configuration. Let's see if it stays lower.

Any configuration advice for a 360 linode?

@nfn:

Any configuration advice for a 360 linode?
Get rid of Apache and install a lightweight web server, such as lighttpd and nginx :P

You're right!

Lighttpd has a very ugly configuration for virtual hosting :(

I used nginx, but since I need to expire images, js and css and there was no option to do it with file types, only extensions, some images that where rewritten from php where having some issues, so I lost may patience :)

Setting an Expires: header is even easier with PHP, if you know which source file to edit…

header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT');

The example above will expire, after 86,400 seconds (24 hours), whatever file gets downloaded through the script. Adjust the interval according to your needs, and place it right before the line that sends the file – which is usually readfile() or sometimes fpassthru().

As for me, after having used lighttpd and nginx, I don't think I'll ever go back to bloated Apache.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct