Rails 4 Load Testing App
This is an application used by the Scout team to benchmark the performance of our application monitoring agent.
Different benchmarks and their associated agents are configured via Git branches. Basic structure:
- master - No app monitoring agent installed. The baseline for the representative test.
- many_queries/fast_endpoint/etc - No app monitoring installed. The name identifies the test.
- [scout|newrelic]_BENCHMARK - a benchmarking test for the specific app monitoring agent.
Running and analyzing test
- Start 3 SSH sessions:
- app server w/rails
- app server w/rails app
- util server where siege will be ran
- App (window 1):
- App (window 1): Clear out past results and start the app:
- Util: Fetch a list of endpoints to benchmark:
wget http://[IP]:8080/users/urls -O urls.txt
- Util: Warmup the app cache:
siege -v -f urls.txt -c 30 -b -t 1M
- App (window 2): Clear out the log file during the warmup:
- Util: Seige:
siege -v -f urls.txt -c 30 -b -t 10M
- App (window 2): When siege completes, gracefully shutdown the unicorn workers:
- App: (window 2): Inspect the log results:
Running tests against the
A different set of URLs needs to be used to for this test:
wget http://[IP]/fast/urls -O fast.txt
fast.txt file vs.
urls.txt with siege:
siege -v -f fast.txt -c 30 -b -t 10M
Monitoring and Profiling
StatsD metrics are reported to localhost so results can be previewed during a test run.
Stackprof is disabled by default so it doesn't influence test results. To enable:
prof=true rake bench:prep
You should see the following via
To view results from the test run:
APM Agent Configuration
All authentication is configured via environment variables:
- Scout - SCOUT_KEY
- New Relic - NEW_RELIC_LICENSE_KEY
RAILS_ENV=production rake db:create db:migrate db:seed