Using Artillery and ab for Server Load Testing
This article demonstrates how to install and run load‑testing tools Artillery and Apache ab, explains their command‑line options, interprets the performance metrics they produce, and provides tips for handling system limits during high‑concurrency tests.
After deploying your own server, you may wonder whether its response speed is sufficient, how well it handles pressure, and what traffic volume it can sustain; the author explores this by using two popular load‑testing tools.
Artillery
Artillery is a actively maintained Node.js‑based load‑testing tool. Install it globally with npm install -g artillery . A quick test can be run using artillery quick --duration 30 --rate 10 -n 20 https://artillery.io , which sends 10 requests per second for 30 seconds from 20 virtual users to the Artillery website. The test generates a JSON report in the current directory and reports metrics such as min, max, median, p95, and p99 response times.
More complex scenarios can be defined in a YAML configuration file and executed directly, but the article focuses on the quick test example.
ab
The Apache ab utility is a classic command‑line load tester. On macOS it is pre‑installed; other platforms require separate installation. An example test is ab -c 1000 -t 10 https://baidu.com/ , which runs for 10 seconds with a concurrency level of 1000 against Baidu. The output includes metrics such as Concurrency Level, Time taken for tests, Complete requests, Failed requests, Requests per second, and various time‑per‑request statistics.
If a very high concurrency level triggers the error socket : Too many open files(24) , increase the system’s open‑file limit with ulimit -n 10000 . The current limits can be inspected via sysctl kern.maxfiles and sysctl kern.maxfilesperproc , and adjusted (if needed) with commands like sudo sysctl -w kern.maxfiles=1048600 and sudo sysctl -w kern.maxfilesperproc=1048576 .
Overall, pressure testing is valuable for identifying performance bottlenecks, and the author encourages readers to experiment with these tools to better understand their server’s capabilities.
System Architect Go
Programming, architecture, application development, message queues, middleware, databases, containerization, big data, image processing, machine learning, AI, personal growth.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.