Test your website from aws ec2 with artillery

April 11, 2020

While you are connected to your ec2 instance with SSH:

Install node (version 6 at least is required)

# install the node version manager
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

# activate nvm
. ~/.nvm/nvm.sh

# install latest long term release of nodejs
nvm install --lts

# see the version installed
node -v

Install artillery with npm

sudo apt-get install npm
sudo npm install -g artillery

Now that artillery is installed you can run a quick test

artillery quick --count 10 -n 20 https://yoursite.com/

This command will create 10 "virtual users" each of which will send 20 HTTP requests to your site

In the end you get similar results:

All virtual users finished
Summary report @ 13:26:13(+0000) 2018-07-16
  Scenarios launched:  10
  Scenarios completed: 10
  Requests completed:  200
  RPS sent: 82.64
  Request latency:
    min: 4.2
    max: 1486.1
    median: 7.6
    p95: 183.3
    p99: 533.2
  Scenario counts:
    0: 10 (100%)
  Codes:
    200: 200

Results explained (from artillery documentation)

Now go and create a script to run your tests 

And continue in https://artillery.io/docs/