Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Apr 02, 2012 7:11 pm 
Offline
Senior Member

Joined: Tue Sep 13, 2011 7:13 am
Posts: 67
I dont know much how to setup apache2 and make it scale. I did use boost drupal module (Stati caching of files) and I tested it with

ab -n 100 -c 10 http://www.mysite.com/index.php

only i changed first 100 to 10 000 and second to 100 but then whole site and server just stopped responding. I shut it down and restarted server and then it started working. But i am wondering what have happend. I dont see any spike on linode dashboard but my server is stuck, will somebody from other site also be able to do this to me and just shut my site/server down? and if so how do prevent this?


Top
   
 Post subject:
PostPosted: Mon Apr 02, 2012 7:13 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Reduce MaxClients to 10 or 20. Disable KeepAlives. Restart Apache.

-Chris


Top
   
 Post subject:
PostPosted: Mon Apr 02, 2012 7:28 pm 
Offline
Senior Member

Joined: Tue Sep 13, 2011 7:13 am
Posts: 67
Ok but will this also then make some limitations to number of users that can access site per second?


Top
   
 Post subject:
PostPosted: Mon Apr 02, 2012 7:36 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
It limits the number of concurrent requests being serviced to 20 (with MaxClients 20). The remaining requests get queued.

Disabling keepalives means that an IDLE browser won't keep one of those slots occupied. It gets in, and gets out - leaving that slot available for someone else.

For example, with MaxClients 20, if each request takes one second, that's about 81.5 million requests per month. Also keep in mind that a 'user' on your site typically makes a bunch of requests and then is done for a while (while they read your wonderful content). So a MaxClients of 20 really means 100s of users... Don't worry about it.

Better this than anyone or a search engine crawler being able to take out your Linode. You want to fix this in any case - webservers tend to ship with unfortunate defaults in distros. We see this all the time.

-Chris


Top
   
 Post subject:
PostPosted: Mon Apr 02, 2012 7:49 pm 
Offline
Senior Member

Joined: Tue Sep 13, 2011 7:13 am
Posts: 67
ok this is what i did, i left the max clients to 40 and kept keep alive as-
http://abdussamad.com/archives/169-Apac ... r-Off.html

says it helps with lots of images, and I do have them, lots of them per page. But i limited it to 70 KA requests and timout to 5. Think this could help make it work better, will see if problems occur to put this numbers lower or even disable it memory gets too crowded.


Top
   
 Post subject:
PostPosted: Fri Apr 06, 2012 8:37 pm 
Offline
Newbie

Joined: Tue Mar 20, 2012 5:13 pm
Posts: 3
Location: Tokyo, Japan
You might want to install nginx in front of your Apache server (or even instead of) to serve your static content, as it can easily handle > 1000 parallel connections. If you have lots of images to serve, nginx or lighttpd are ideal, while Apache is one of the worst webservers to handle this load. It definitely has its uses, but being robust and serving lots of small files isn't one of them :)

Also, it's easy to take down by a bad person, as you already found out. Even if you limit MaxClients to 20, someone can just use a tool like slowloris and DoS your server. :( That's not possible with one of the newer webservers like nginx, lighttpd or Cherokee.


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