Browse Source

documentation

pull/1/head
Nicolas Massé 8 years ago
parent
commit
e39300ea36
  1. 23
      performance-testing/README.md

23
performance-testing/README.md

@ -6,7 +6,7 @@
- Edit `apicast/conf/nginx.conf` to set `worker_connections` to a much reasonable setting for a development machine - Edit `apicast/conf/nginx.conf` to set `worker_connections` to a much reasonable setting for a development machine
- Launch a development apicast with the following parameters: - Launch a development apicast with the following parameters:
``` ```
export APICAST_LOG_LEVEL=crit export APICAST_LOG_LEVEL=error
export THREESCALE_CONFIG_FILE=config.json export THREESCALE_CONFIG_FILE=config.json
sudo sysctl -w kern.maxfiles=65536 sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536 sudo sysctl -w kern.maxfilesperproc=65536
@ -18,6 +18,9 @@ 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 **WARNING:** On MacOS, you have to run apicast **as root** to be able to push up
the maximum number of open files (`ulimit -n`). the maximum number of open files (`ulimit -n`).
**NOTE:** the `-w 8` tells nginx to start 8 workers. As a rule of thumb, set the
number of workers to the number of available cores.
- Install and run a rsyslog server: - Install and run a rsyslog server:
``` ```
sudo brew install rsyslog sudo brew install rsyslog
@ -63,15 +66,25 @@ Run the gatling scenario:
gatling.sh -sf . -s itix.Apicast1kPOST gatling.sh -sf . -s itix.Apicast1kPOST
``` ```
Check that you have exactly 200000 lines in both `apicast.log`: Check that you have exactly 200000 lines in the `apicast.log` generated
- the one created by the apicast server by the apicast server:
- the one created by the rsyslog server
``` ```
$ wc -l apicast.log $ wc -l apicast.log
200000 apicast.log 200000 apicast.log
``` ```
Also, check that you have exactly 200000 requests logged
in `/tmp/apicast.log`:
```
$ grep -o '"http_version"' /tmp/apicast.log |wc -l
200000
```
**NOTE:** you might have to wait a few seconds after gatling completed the
performance test to have the 200000 lines in the apicast.log.
This is due to the SYSLOG_PERIODIC_FLUSH parameter (5 seconds by default)
that is needed to flush the last requests from the log buffers.
## Reference ## Reference
- https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration - https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration

Loading…
Cancel
Save