measuring performance - using real clicks vs "ab" command

Posted by shanyu on Stack Overflow See other posts from Stack Overflow or by shanyu
Published on 2009-11-27T12:57:44Z Indexed on 2010/04/08 21:03 UTC
Read the original article Hit count: 283

Filed under:
|
|

I have a web site in closed beta, developed in Django, runs with Mysql on Debian.

In the last few days, the main page has been showing a slowdown. For every ten clicks, one or two receives extremely slow response (10 secs or more), others are as fast as they used to be.

When I was searching for the problem, I ran into this issue that I couldn't grasp:

top command shows that when I request the main page, mysql shoots up to 90% - 100% cpu usage. I get the page just as the cpu use gets back to normal. So, I thought, it is db.

Then I called ab with parameters -n 1000 -c 5, I got decent performance, about 100 pages per second, just as it was before the slowdown. I would imagine a worse performance as 10-20% of requests take 10 secs to load.

Is this conflict between ab and "real" clicks normal, or am I using ab in a wrong configuration?

© Stack Overflow or respective owner

Related posts about web-development

Related posts about django