How can I emphasize loading a web form file?

I need to test a web form that uploads a file. The file size in each download will be about 10 MB. I want to check if the server can handle more than 100 simultaneous downloads and still remain responsive to the rest of the site.

Repeated applications from our office will be limited to our local DSL line. The server is down with higher bandwidth.

Experience-based answers will be great, but any suggestions are welcome.

+4
source share
3 answers

Use the ab (ApacheBench) command line tool that comes with Apache (I just opened this great tool). Unlike cURL or wget, ApacheBench was designed to perform stress tests on web servers (any type of web server!). It also generates a lot of statistics. The following command will send an HTTP POST request, including the test.jpg file test.jpg to http://localhost/ 100 times, with 4 simultaneous requests.

 ab -n 100 -c 4 -p test.jpg http://localhost/ 

It produces a conclusion as follows:

 Server Software: Server Hostname: localhost Server Port: 80 Document Path: / Document Length: 0 bytes Concurrency Level: 4 Time taken for tests: 0.78125 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Non-2xx responses: 100 Total transferred: 2600 bytes HTML transferred: 0 bytes Requests per second: 1280.00 [#/sec] (mean) Time per request: 3.125 [ms] (mean) Time per request: 0.781 [ms] (mean, across all concurrent requests) Transfer rate: 25.60 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.6 0 15 Processing: 0 2 5.5 0 15 Waiting: 0 1 4.8 0 15 Total: 0 2 6.0 0 15 Percentage of the requests served within a certain time (ms) 50% 0 66% 0 75% 0 80% 0 90% 15 95% 15 98% 15 99% 15 100% 15 (longest request) 
+8
source

I would probably advise you to use cURL and send only random things (for example, read 10 MB from /dev/urandom and encode it in base32), through a POST request and manually build the body to upload the file (this is not rocket science).

Enter the script 100 times, possibly on multiple servers. Just make sure that system administrators do not think you are doing DDoS, or something :)

Unfortunately, this answer remains a little vague, but I hope it helps you push you on the right track.

Continued according to Liam's comments:
If the server receiving the downloads is not on the same local network as the clients connecting to it, it would be better to get the most remote nodes for stress testing, at least to simulate the behavior as reliable as possible. But if you do not have access to computers outside the local network, a local area network is always better than nothing.

Testing stress from the same equipment would not be a good idea, since you would do a double load on the server: compute random data, pack it, send it through the TCP / IP stack (although probably not via Ethernet), and only then can the server do its magic. If the transmitting part is outsourced, you get doubled (taken with an arbitrary grain size of salt) on the receiving side.

0
source

Automate Selenium RC using your favorite language. Run 100 Selenium threads, each of which enters the file path in the input file and clicks the submit button.

You could generate 100 sequentially named files to make them interleave easily or just use the same file over and over again

0
source

All Articles