An apicast module that logs API requests and responses for non-repudiation purposes
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.
 
 
Nicolas Massé bc07b7feb3 add performance tests 8 years ago
..
.gitignore add performance tests 8 years ago
Apicast1kPOST.scala add performance tests 8 years ago
README.md add performance tests 8 years ago
config.json add performance tests 8 years ago
rsyslog.conf add performance tests 8 years ago

README.md

Performance Testing

Setup

  • Download and install gatling.
  • 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:
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