Code Monkey home page Code Monkey logo

webapp's Introduction

webApp

webApp is container image to simulating CPU/Memory intensive or high latency workload.

Introduction

This web app is built with apache httpd and php. It can simulate CPU intensive, Memory intensive, or High latency workload. It can accept Get or Post requests to simulate different level of workloads.

It also enables the mod_status of the httpd server, so that user can have a easier way to understand the workloads.

Build docker image

Build a docker image. (beekman9527/webapp is the image in dockerhub)

$ export imageName="webapp"
$ docker build -t $imageName .

Run container

First, run the container from the image.

# 28080 is host port.
$ docker run -d -p 28080:8080 $imageName

Second, access the web Page via:

http://hostIP:28080/index.html
or
http://localhost:28080/index.html

Test workload

All the pages can be accessed via HTTP GET or POST, and the parameters are the same.

Latency simulation

It has one parameter value, the duration to delay(or sleep in server side), in milliseconds.

For example, delay 30 ms. Access it via web browser

http://localhost:28080/workload.php/?value=30

Access it via curl Post

curl -H 'Content-Type: application/x-www-form-urlencoded' -X POST -d 'value=30' http://localhost:28080/workload.php

Memory intensive simulation

It has two parameters, memory is amount of memory (in MB) to consume; the other is value, the duration to hold the memory, in milliseconds.

For example, consume 10 MB memory, and hold the memory for 110 ms. Access it via web browser

http://localhost:28080/memwork.php/?value=110&memory=10

Access it via curl Post

curl -H 'Content-Type: application/x-www-form-urlencoded' -X POST -d 'value=110&memory=10' http://localhost:28080/memwork.php

CPU intensive simulation

It will use as much CPU as possible to compute the MD5 for huge amout of integers. It has one parameter, cpu, indicating the amount of computation.

Access it via web browser

http://localhost:28080/cpuwork.php/?cpu=30

Access it via curl Post

curl -H 'Content-Type: application/x-www-form-urlencoded' -X POST -d 'cpu=30' http://localhost:28080/cpuwork.php

webapp's People

Contributors

songbinliu avatar

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.