Stress Testing Guide for Nginx On Ubuntu VPS

2025-06-28 23:19:53 - Rao Ashish Kumar

βœ… Objective

To evaluate how our API /api/testendpoint handles different levels of concurrent user loads and request volumes on our VPS environment.



πŸ› οΈ Tools Used


πŸ”₯ Step 1: Install Apache BenchmarkOn Ubuntu VPS:

sudo apt install apache2-utils -y

🚦 Step 2: Running the Stress TestsπŸ”Έ Test 1 β€” Moderate Load:

ab -n 500 -c 50 http://<server-ip>/api/testendpoint

πŸ”Έ Test 2 β€” Lighter Concurrency:

ab -n 200 -c 25 http://<server-ip>/api/testendpoint

πŸ”Έ Test 3 β€” High Volume, Low Concurrency:

ab -n 5000 -c 50 http://<server-ip>/api/testendpoint

πŸ” Step 3: Monitoring with Netdata

🎯 Observations Summary Test Concurrency Avg Response RPS Failures CPU Impact 1 50 1.3s ~38 0 100% spike 2 25 594ms ~42 0 Moderate 3 50 1.3s ~38 0 100% spike πŸš€ Recommendations


πŸ”₯ Request Flow During ab Test:

ab tool β†’ NGINX β†’ PHP-FPM (Laravel) β†’ PostgreSQL (if DB involved)



βœ… Conclusion

This document serves as the record for how we conducted our stress testing, what was observed, and the actionable outcomes.

More Posts