Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm a real noob when it comes to sys admin. I'm running an app on an EC2 MicroInstance.

Before I launch publicly, I want to make sure that I hit a minimum level of performance. I'm trying out some stress testing but I've struggled to find good comps out there to help me understand my own performance.

I've tested the page with arguably the most load and I'm curious if this is suitable enough for a website that is just launching and, best case scenario, could see 10k uniques in a week if the press hits just right.

    ab -n 5000 -c 10 http://mysite.com

    requests/sec: 53.36
    time per request:  18.739 ms
    transfer rate: 12.66kb
    total transferred 1215000 bytes

No failed requests. My CPU topped out at around 49% and memory wasn't taxed very much. Load average spiked at 5.70.

95% of requests were served within 500ms. One request took 84996ms.

I'm using Apache2.x with mod_wsgi on Ubuntu 10.4. I'm pretty certain the MPM is Prefork. This server is in test mode, so there's no outside load.

Concurrency seems to be the big issue here. When I remove it, the server is lightning fast. When I add more concurrency beyond 10, I get an error which says: "timeout specified has expired (70007)".

This might all be moot because I'm just starting out. I'm curious to hear opinions.

Thanks.

share|improve this question
    
any idea what MPM you're running (worker, prefork, etc) ? –  DTest May 12 '11 at 17:27
    
I referenced prefork above...god help me if I know what that REALLY means... –  Ben May 12 '11 at 17:28
    
damn, I just can't read. Sorry about that :D –  DTest May 12 '11 at 17:29
    
No worries, I was trying to point out my own ignorance :) –  Ben May 12 '11 at 18:13

2 Answers 2

up vote 2 down vote accepted

Some things I would look at when tuning prefork apache:

  • Check your MaxClients and ServerLimit. This tells your server how many processes it can have running at once. You should limit based on the memory each process runs compared to your RAM limitations. Be sure to leave memory for other programs running on the server (system, MySQL, etc)

  • Check StartServer, MinSpareServers, MaxSpareServers. Make sure you start the server with enough processes to handle incoming requests, and that you keep enough around to handle the load. The cost of creating new threads is relatively expensive and will slow down your requests.

  • Keep your KeepAliveTimeout real low. This is basically how long a process remains open long enough to capture further requests before moving on to the next request. For prefork, I keep mine at 2 KeepAliveTimeout 2

Just a few pointers...hope this helps

share|improve this answer
    
Thanks DTest, these are all really helpful points. I guess my big question is, does my current setup seem like it's "good enough" given that I'm just launching my site? Over time, I'll definitely improve performance (and upgrade from a Micro Instance). For right now, though, do the benchmarks I provide seem generally scary? I know it's tough to say without actually looking through more of my config...:( –  Ben May 12 '11 at 17:59
    
To me, being able to handle 56 requests/second on your site with 10 at a time, sounds good to begin with. Hell, I wish I could get my setup to perform so well. Granted, I have some hefty code running. My answer was to try to help resolve the issue of increasing concurrency, to see if that helped at all. GL –  DTest May 12 '11 at 18:19

Remember that EC2 micro instances have CPU bursting - you can use up to two compute units, but only for a short period of time. After that (fairly small) period of time, your CPU usage is severely capped for several minutes.

If you want more consistent performance, move to a Small instance type.

share|improve this answer
    
Hi cee, I would like to eventually shift to a Small Instance. The question is whether it's worth it right now given my above benchmarking and the fact that I'm just going to launch publicly next week. –  Ben May 12 '11 at 18:13
    
I'd bump up to a Small instance temporarily, re-run your benchmark, and see if you get better results. Should help troubleshoot, at the least, and you can blow away the instance after an hour or two and only incur a few pennies of cost. –  ceejayoz May 12 '11 at 18:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.