Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache configuration
PostPosted: Tue Feb 24, 2009 8:15 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
Hi,

Recently I was advised to setup apache like this:

<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 15
MaxClients 150
MaxRequestsPerChild 1000
</IfModule>

I was running with this configurations:

<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 100
MaxRequestsPerChild 500
</IfModule>

Note that I'm in a 360 linode using ubuntu 8.10.
Why are the real differences?

Thanks
n


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 8:27 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
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.


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 8:35 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
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?


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 11:03 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
nfn wrote:
Any configuration advice for a 360 linode?

Get rid of Apache and install a lightweight web server, such as lighttpd and nginx :P


Top
   
 Post subject:
PostPosted: Wed Feb 25, 2009 2:55 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
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 :)


Top
   
 Post subject:
PostPosted: Wed Feb 25, 2009 4:41 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Setting an Expires: header is even easier with PHP, if you know which source file to edit...

Code:
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group