14

I am developing a website (basically a public facing site). How can I simulate multiple users are surfing my site and doing various activities so that I can understand how my site will behave in a real time environment?

I am using Apache server and PHP.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
voila
  • 1,594
  • 2
  • 19
  • 38
  • For quick tests, you can use [ApacheBenchmark `ab`](https://httpd.apache.org/docs/2.0/programs/ab.html) which might already be installed on your terminal. – Ulysse BN May 28 '19 at 21:54

8 Answers8

9

As mentioned in previous posts, you will need a load test tool. The good news is that there are many tools and services in this field: open source load test ones like JMeter and Gatling, commercial one like Loadrunner and Neoload, the bad news is that you have to answer some questions and make some decisions.

One key decision you need to make is whether to test your application in the lab or in the cloud.

  • cloud based testing: Blazemeter, soasta, neustar ...
  • in-lab testing: JMeter, Gatling, Neoload, loadrunner, webperformer ....

In addition, you need to answer the following questioins:

  • how many virtual clients you want to emulate to stress the server

  • how much budget do you have

  • how complex is the web application

  • how much skills do the tester(s) have.

If you have high budget, complex web application and testers with good skills (like a developer), you can consider Loadrunner, NeoLoad.

If you have low budget but your tester(s) have good skills, you can consider Jmeter and Gating.

If you need to emulate lots of virtual clients (say 10000) to stress your complex web site and your tester(s) don't have the skill of a developer/programer, you may want to consider NetGend. There is a blog site where you can find out how complex performance testing can be (like filling HTML forms, extract values from JSON messages etc) and how easy it is on NetGend platform. By the way, you don't need high budget for NetGend.

Good lucky in your load/performance testing!

pktCoder
  • 1,105
  • 2
  • 15
  • 32
2

What you want is a load testing tool, there are several but id check out Neoload. You could also use Selenium and the various way to run selenium tests automatically

aL3891
  • 6,205
  • 3
  • 33
  • 37
2

As this is your first time engaging in this task you would be well advised to find someone who has been there, done that and developed the battle scars from this activity. It is not a trivial effort to performance test a piece of software. If you listen to the traditional software vendors they will tell you that "any business analyst can use this tool and be effective" as if the tool is 85-95% of the skills you will need to be able to successfully performance test an application or a site. This is marketing foo to remove barriers to a sale.

In actuality the tool you select is anywhere from 5-15% of the total skill set you will need to be successful. Also, if the financial risk of failure is sufficiently high to warrant a performance test then it almost matters not which tool you pick, for the cost of the tool and the expertise will be dwarfed by your financial risk of not scaling.

If you don't have time to develop the skills or enough lead time to get a solid performance tester then you may want to consider some of the managed services offerings in the market, such as SOASTA, which can provide the expertise and the tool bundled within the deal. Here are some things you will want to look at in advance of any test (common issues)

  • Load Balancer misconfiguration resulting in distorted load to one node
  • Not appropriately managing your cache age for your static resources (.jpg, .css, ...) resulting in higher than expected load
  • All of your lookup queries to the database should be index optimized. Use a database profiler to check this
  • Holding onto resources too long. If your 95th percentile page to page request delay is five minutes then don't set your timeout at 30 minutes or 90 minutes for the HTTP session. This will hold onto resources far too long for the dead session. I use a rule of thumb of 95th percentile value times 1.5.
  • if this is a shopping site then don't hand out a default cart to everyone who shows up. Make sure they are on the revenue path before you hand them a cart, such as looking at the cart or placing something in the cart. Otherwise you have just built a 1:1 relationship with every customer and just about every piece of your architecture from web server to app server to the database server where the cart is created and managed
  • Also on the cart front, implement a 100x100 rule. If someone has a 100 items in the cart pick up the phone and call them to personalize the sale. If you have persistent carts which never expire then consider implementing a 100 day rule for evacuating from the cart items of that age or killing a cart altogether which hasn't been touched in that period. These people are clearly not on the revenue path.
  • Consider your design for ecommerce. Every step between add to cart and checkout is an opportunity to abandon the sale. The fewer the steps the greater the conversion rate: This is the genius behind the Amazon one click checkout. Minimize your number of steps and you will see a higher revenue flow as a result.
James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • "Use a database profiler to check this" -- do you have a preferred tool you'd recommend? – a20 Apr 12 '15 at 14:38
  • All commercial database products, such as SQL Server, Oracle, DB2, RDB, etc..., have built in profiling capabilities. If you are in the open source universe with a database such as MySQL or PostgreSQL, then you will need to ask around for opinions on the better tools for capturing the statistics to produce a profile report – James Pulley Apr 12 '15 at 19:02
1

I would recommend gatling for load testings. It's scala based but a recorder is provided to generate workload test cases.

=> http://gatling-tool.org/

thesmash
  • 599
  • 6
  • 9
1

It's important to set some dimensions for test tool assessment to simulate user traffic:

  • SLA details (performance goals such as pages per second (PPS), http request per second (HPS), throughput, CPU usage etc.)
  • Virtual user size to simulate (You will need this info to decide number of slave PCs/VMs, in other words that's called load generators, according to virtual user number range)
  • Maintenance cost of scripts over changes
  • Effort to develop and execute test scripts
  • Number of test scenarios
  • Scheduling needs (You may want to schedule tool in regular basis or execute test on-demand if needed)
  • Budget for test tool licenses and ROI (return of investment) calculations (Price, tool expertise cost, utilizaton of test tool on other web applications etc)
  • Metrics provided by test tools
  • Monitoring requirements of network, servers and client
  • Integration with current test infrastructure (If HP ALM exist, you may be interested in Loadrunner)

If you are in hurry and don't have time to evaluate which tool to select, you may start with JMeter.

Selenium can be used for test automation of regression tests, I would like to highlight it's not effective for performance test due to its API. Sahi is another option for test automation.

Semanur Konezoglu
  • 63
  • 1
  • 2
  • 11
1

I think that you are definitely looking for a load testing tool like Blazemeter. I recently discover this webinar which shows you how to do load testing on your application using a PaaS provider as a development and runtime environment, where you can deploy your application to run the load tests. They combine Blazemeter with a monitoring tool, New Relic in this case, to see the way in which you detect the new users surfing on your website. It is really cool and very interesting since you can know what is the performance of your application with a specific infrastructure.

Captain Haddock
  • 488
  • 2
  • 7
  • Everyone's ooh-aah over BM but I actually tested with it. Free for up to 50 users and very expensive thereafter. My laptop can do 50 users easily. The pretty charts are only pretty, not very useful. New Relic is expensive also, but that's a real useful investment. IMO get New Relic, but find a cheaper alternative to BlazeMeter for the stress testing. – a20 Apr 12 '15 at 14:36
1

Simple.

  1. Set up server / application monitoring - New Relic is the easiest and most powerful. Free for 14 days.
  2. Record a typical user's activity - Use JMeter to set up a proxy on your laptop and route web requests, mobile app usage etc through it. Sounds difficult but it's really easy. JMeter can act as the man-in-the-middle and capture all the requests sent by the browser/app to the server(s).
  3. Now you "clone" the above user as many times as you need/could and blast the server. Initially you'd run the load test from your dev machine. Mine can take up to 80 concurrent users before cpu/ram runs out. Beyond this level explore BlazeMeter (free 50 concurrent users), jmeter-ec2 script (free), flood.io etc. Upload your script and blast away at your server. Ideally you should run incremental stress tests at your server. 10 users, 50 users, 100 users, 200 users etc.
  4. Analyse, fix issues & ramp up the stress - In between each stress blast, go over your new relic. How is the application & server performing? What's failing? How are the alerts working?
a20
  • 5,495
  • 2
  • 30
  • 27
0

If you are also searching for UI-Testing, you should check out Sahi Pro 6 automated testing tool, it also can be integrated with Jenkins.

==> http://sahipro.com/

It is really easy to record user actions with it on any browser and just playback the recorded scripts. You can run scripts simultaneously on multiple browsers, thus simulate multiple users browsing your page:

https://sahipro.com/docs/using-sahi/playback-desktop.html#Distributed%20Runs%20-%20More%20Information

dima
  • 158
  • 3
  • 14