X
X
xSkyFoXx2011-04-18 23:58:18
Software testing
xSkyFoXx, 2011-04-18 23:58:18

Site load testing

Tell me, please, how can I check at what number of visitors the site will fall? There was a weak server and I forgot about the cache - after 1000 people in an hour everything fell. I improved the hardware, installed caching, nginx and took the database server to another physical machine. I want to find out how many visitors such a configuration can withstand. How to check it? By what means to estimate at least an order of magnitude? (website in php+mysql)

Answer the question

In order to leave comments, you need to log in

8 answer(s)
C
cbx, 2011-04-19
@cbx

If you want to simply and quickly, then the Apache Benchmark that comes with the Apache web server will fit perfectly. Something like this:
ab -n 1000 -c 10 http://my.site.dot.com/url/path/
By varying the number of simultaneous connections (-c 10) and the total number of requests (-n 1000), you can roughly estimate when the site starts to die. It is better to test from another machine. It is also worth considering that if the content of the page changes from request to request (dynamics), then AB will consider such server responses as Failed: www.celebrazio.net/tech/unix/apache_bench.html It
is better to start testing from the most frequently visited pages based on analytics site, as well as focusing on your understanding of its structure (if the site is self-written, then you should perfectly represent its sections that are weak in terms of performance).
If you want more, see the richer Apache JMeter or Tsung (the first is graphic, the second is console). Both are able to cluster and generate load from several machines (for this it is convenient to rent instances in Amazon EC2), they have a built-in proxy for recording user sessions and allow you to set the client connection speed (relevant for simulating slow clients and assessing the impact of the same nginx). UPD: Yandex Tank is still good
In any case, before measuring the performance of the site, take care of monitoring the servers on which this site is running. Without this, there is very little point in benchmarks - they will give you some numbers, but you will not have a further plan of action. At a minimum, run the top utility on the machines and see the CPU load, memory consumption and disk activity. Also, after testing, look at the logs for errors that appear (lack of sockets, memory, web server or database errors). It is useful to enable logging of slow queries in MySQL.
Further - eliminate the identified bottlenecks and repeat the process again until you reach an acceptable level of performance.

S
StopDesign, 2011-04-19
@StopDesign

loadimpact.com/ allows you to load the site (requests, traffic).
On a real project, robots can affect the operation of the site, because. request unpopular pages that are most likely not cached (or the cache is out of date). Therefore, you can try to load the entire site (wget) and at the same time check the upload speed (ab or loadimpact).
If this did not help to flood the site, try ordering a small DDoS (GET and POST requests).

D
Dmitry, 2011-04-19
@dimanjy

The first thing to do here is to do some calculations.
Measure the execution time of a PHP script, convert to seconds and multiply by the number of PHP worker processes. You will get the number of requests your system can handle per second. Knowing the number of requests to PHP generated by one user on your project, you can calculate the maximum allowable number of simultaneous users.
And from the tools, the well-known ab (Apache Benchmark). Another very interesting inject from the creator of haproxy. In it, you can set scenarios for user behavior.

N
nightfly, 2011-04-19
@nightfly

Should I try synthetics like ab or siege first?

A
ap3rus, 2011-04-19
@ap3rus

If you have a separate server, you can try JMeter for automated loading.

P
pietrovich, 2011-04-19
@pietrovich

tynts

O
Oleg Svirchev, 2014-04-01
@svirchoff

Try Loaddy.com. 50 users for free. 500 users for 10 minutes of testing costs only $1. No synthetics can show true results. They have extras there. URL can be specified.

A
AlexBelousova, 2018-01-18
@AlexBelousova

+1 to Loaddy. Very convenient service, I use it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question