Skip to content

Instantly share code, notes, and snippets.

@lcchou2
Last active March 14, 2019 02:57
Show Gist options
  • Save lcchou2/19cb347db9381a22e004c9a09d8d6b77 to your computer and use it in GitHub Desktop.
Save lcchou2/19cb347db9381a22e004c9a09d8d6b77 to your computer and use it in GitHub Desktop.
RPS for proxy on EC2 instance

RPS for EC2 Proxy

Loader

Settings
GET Restaurants
Clients per second: 485
Duration: 60 seconds
Method: GET
Protocol: HTTP
Host: http://ec2-54-153-17-136.us-west-1.compute.amazonaws.com
Path: /overview/%{*:1-10000000}
GET Reviews
Clients per second: 300
Duration: 60 seconds
Method: GET
Protocol: HTTP
Host: http://ec2-54-153-17-136.us-west-1.compute.amazonaws.com
Path: /overview/ratings/%{*:1-10000000}
Results
GET Restaurants
Response Times:
  Average: 210 ms
  Min/Max: 125 / 1193 ms

Response Counts:
  Success: 29097
  Timeout: 0
  400/500: 0 / 0
  Network: 0

Bandwidth:
  Sent: 4.4 MB
  Received: 104.18 MB

Redirects:
  Valid: 0
  Invalid: 0

Error Rate: 0.0%
GET Reviews
Response Times:
  Average: 1013 ms
  Min/Max: 127 / 3027 ms

Response Counts:
  Success: 16994
  Timeout: 148
  400/500: 0 / 0
  Network: 0

Bandwidth:
  Sent: 2.80 MB
  Received	24.64 MB

Redirects:
  Valid: 0
  Invalid: 0

Error Rate: 0.9%
New Relic
GET Restaurants
Error Rate: 0.01%
Throughput: 19.8k
Latency: 834 ms per request
GET Reviews
Error Rate: 0.09%
Throughput: 14.2k
Latency: 971 ms per request
Server.js
require('newrelic');
const express = require('express');
// const morgan = require('morgan');
const path = require('path');
const proxy = require('http-proxy-middleware')
ss();

const port = 80
app.get('/loaderio-xxxxx', (req,res) => {
  res.send('loaderio-xxxxx')
  
})

app.use(express.static(path.join(__dirname, 'public')));
app.use('/overview', proxy({
  target: 'http://ec2-54-183-204-115.us-west-1.compute.amazonaws.com/'
}));
app.use('/api/photos', proxy({
  target: 'http://ec2-52-15-166-74.us-east-2.compute.amazonaws.com/'
}));
app.use('/api/reserve', proxy({
  target: 'http://ec2-18-223-125-61.us-east-2.compute.amazonaws.com/'
}));
app.use('/menu', proxy({
  target: 'http://ec2-54-86-231-192.compute-1.amazonaws.com/'
}));


app.use('/:id', express.static(path.join(__dirname, 'public')));

app.listen(port, () => {
  console.log(`Listening to server at http://localhost:${port}`);
})



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment