You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
8 years ago | |
|---|---|---|
| .. | ||
| .gitignore | 8 years ago | |
| Apicast1kPOST.scala | 8 years ago | |
| Apicast10kPOST.scala | 8 years ago | |
| README.md | 8 years ago | |
| config.json | 8 years ago | |
| rsyslog.conf | 8 years ago | |
README.md
Performance Testing
Setup
- Download and install gatling.
- Edit
apicast/conf/nginx.confto setworker_connectionsto a much reasonable setting for a development machine - Launch a development apicast with the following parameters:
export APICAST_LOG_LEVEL=crit
export THREESCALE_CONFIG_FILE=config.json
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
sudo launchctl limit maxfiles 65536 65536
ulimit -n 65536
bin/apicast -i 3600 -m on -w 8 &> apicast.log
WARNING: On MacOS, you have to run apicast as root to be able to push up
the maximum number of open files (ulimit -n).
- Install and run a rsyslog server:
sudo brew install rsyslog
/usr/local/Cellar/rsyslog/*/sbin/rsyslogd -4 -n -f rsyslog.conf -i "$PWD/rsyslog.pid"
Recording a scenario (OPTIONAL)
Gatling scenario are available in the performance-testing directory. However, you can record your own by :
- Launcing the recorder and starting a recording
- Doing a test request through the gatling proxy
export http_proxy=http://localhost:8000
curl "http://localhost:8080/?user_key=secret" -D - -X POST -d "data"
Then, you can customize the scenario to loop over the request you recorded and add virtual users.
Running a scenario against the vanilla apicast
Run the gatling scenario:
gatling.sh -sf . -s itix.Apicast1kPOST
Running a scenario against the apicast with the logging module
Then, re-start apicast with the following environment:
export APICAST_MODULE=custom/verbose
export SYSLOG_HOST=127.0.0.1.xip.io
export SYSLOG_PORT=1601
export SYSLOG_PROTO=tcp
export SYSLOG_PERIODIC_FLUSH=5
export SYSLOG_FLUSH_LIMIT=10240
Run the gatling scenario:
gatling.sh -sf . -s itix.Apicast1kPOST
Check that you have exactly 200000 lines in both apicast.log:
- the one created by the apicast server
- the one created by the rsyslog server
$ wc -l apicast.log
200000 apicast.log
Reference
- https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
- http://blog.martinfjordvald.com/2011/04/optimizing-nginx-for-high-traffic-loads/
- http://gatling.io/docs/current/general/simulation_setup/#injection
- http://gatling.io/docs/current/cheat-sheet/
- https://superuser.com/a/867865