LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-16-2013, 05:06 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
How to use Apache Bench to simulate server load on a Wordpress cluster?


I'm working on a clustered Wordpress site installed in the Amazon Cloud (uses ELB, EC2, RDS, S3). I'm trying to scheme up a stress test before go-live so we can see if it'll support the traffic load we want. We want to simulate "10,000 simultaneous users." I interpret that as meaning we have 10k users each clicking a page every 10 seconds or so. With that in mind, our system would need to service 60,000 page requests in one minute. I'm thinking I'll use Apache Bench and wondering a couple of things:
1) I'm wondering how many of these "users" a single machine might be able to simulate so I can determine how many machines I need for simulating load. I imagine this would depend on a variety of factors including CPU power, network connection speed, RAM, etc. Any thoughts on calculating this in an Amazon EC2 context?
2) We don't want a single computer asking for the same URL 10,000 times. Any thoughts on how to randomize page accesses? Do I need a list of all the URLS? I don't see any features of this command that permit requesting more than one url.
3) Given that I'll probably need numerous machines to simulate this kind of load, any thoughts on how to start/stop many machines efficiently?
4) Can anyone suggest a good sample command line for some beautiful graphs to wow the client?
5) What about cookies? One can apparently send the same cookie with every request, but there doesn't seem to be any capacity to accept cookies and elicit the corresponding cookie-affected behavior on the server. I.e, there are no session-savvy input values.
6) Does AB just request the file itself or would it also load all the images, css, iframes, etc. specified?
7) Any other considerations come to mind?

All thoughts and discussion welcome.
 
Old 01-18-2013, 02:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ab is a very useful, but very simple tool. You migth prefer to use grinder for a more life like load generation. insofar as ab goes though...

1) Loads and loads. firing a request really isn't challenging. One page loaded in a browser will probably relate to maybe 6 HTTP requests (nic css, a few images etc.) and you can easily do all 6 in parallel in 1s if you know what you want to request. That's one impatient users load for, say, 30 seconds before they click another link, so you can do another 30 users in that time without any difficulty. These things all depend on the speed of the server though, as they are queued to a given level on concurrency. If you're not page scraping and pulling links to request out of the prvious response, you should be able to just request and dump 500 concurrent users trivially, probably lots more.

2) You'd need to find them, and script them yourself. start an instance for gifs, one for file a, one for file b etc... that's pretty simple to kick off, just not using ab directly.

3... 4... 5... you know... you really can NOT use ab... use a decent thing. You are right on the multi node approach if you want that many users, and grinder uses a client server architecture, and is really quite simple to get going and seems very suitable for you.
 
Old 01-18-2013, 10:20 AM   #3
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Thanks, A_C!

Do you mean this grinder ? This seems like a more general-purpose tool than I had in mind and the documentation has a fairly abstract bent to it. I'll look at it some more but expect the learning curve may be a bit steep for my deadlines (Monday!).

Quote:
2) You'd need to find them, and script them yourself. start an instance for gifs, one for file a, one for file b etc... that's pretty simple to kick off, just not using ab directly.
I guess I'm a bit disappointed that some easily configured, specialized HTTP testing suite doesn't already exist. It seems simple to me:
Code:
* specify a collection of urls to be accessed randomly (or in sequence)
* specify whether to handle cookies or perhaps when to drop one's cookies (e.g., after a sequence of urls is complete)
* specify some degree of concurrency (e.g., number of threads or number of users to simulate)
* specify length of test or how many times to iterate
* application performs a boatload of http requests, asking for pages and their content assets (images, js, css)
I'll certainly be looking into grinder, and I appreciate the advice.

I may also consider scripting the launch of numerous AB processes, each requesting a single page.
 
Old 01-18-2013, 03:22 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you have a *specific* set of "simple" requirements in this "simple" tool. Other people will have other "simple" requirements...
 
Old 01-20-2013, 04:07 PM   #5
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by acid_kewpie View Post
well you have a *specific* set of "simple" requirements in this "simple" tool. Other people will have other "simple" requirements...
This is true. Sadly, I don't know much Python and am wary of flaws in Java. Still, grinder looks compelling.
 
Old 01-21-2013, 01:46 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Hmm, Yeah the recent java flaws have nothing at all to do with a java app. That's about browsers. No such concerns exist for an app like Grinder on a private network.

I just picked a simple test script from the library and hacked it around a bit, it was pretty simple in general.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache logs in a load balanced cluster wademac Linux - Server 1 05-10-2012 02:06 AM
simulate cluster environment in HP 520 laptop satya5509 Linux - Laptop and Netbook 3 05-05-2011 01:29 AM
Apache: You don't have permission to access /wordpress/ on this server. IKT Linux - Server 18 08-20-2009 07:41 AM
apache bench wackolacko Linux - Server 2 12-21-2008 12:49 PM
highly available and load balanced apache cluster uttam_h Linux - Software 1 08-30-2007 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration