Giter VIP home page Giter VIP logo

gcp-perf-test's Introduction

Performance Test

This test is a speculative performance test about serving static assets from GCP.

Setup: web server serving a file of roughly 500KB gets deployed in a GCP VM. Load test: request the file using the external IP of the VM.

Prerequisites

  1. Docker
  2. Python 3
  3. gcloud CLI

1. Create Web Server Image and Push to GCR

Create a docker image based on nginx in order to serve a static asset of 500KB+.

PROJECT_ID=kudos-spikes
# Generate a varies sizes of index.html 
for i in {1..7}; do python3 -c "for i in range(0,26000 * ${i}): print('test',end='')" > web-server/index-${i}00.html; done
docker build -t gcr.io/$PROJECT_ID/gcp-perf-test-nginx web-server/
docker push gcr.io/$PROJECT_ID/gcp-perf-test-nginx

2. Create Infrastructure and Deploy Web Server

Create a VM in Google Cloud Platform running a docker container based on the image previously built.

PROJECT_ID=kudos-spikes \
CONTAINER_IMAGE=gcr.io/$PROJECT_ID/gcp-perf-test-nginx \
bash infrastructure.sh

3. Run Test and Print Report

Run a load test using vegeta.

The load is configurable through the test/test.sh file.

docker build -t gcp-perf-test-nginx test/
URL="http://`gcloud compute instances describe gcp-perf-test-nginx --format='get(networkInterfaces[0].accessConfigs[0].natIP)'`"
docker run --env RESOURCE_BASE_URL="$URL" gcp-perf-test-nginx

gcp-perf-test's People

Contributors

fprojetto avatar timlittle avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jwcastillo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.