Public Repository

Last pushed: 4 months ago
Short Description
Stress tester using the 'stress' package from Harvard Edu.
Full Description

Usage:

The docker can be run without arguments to spawn 4 CPU workers and bloat 90% of the available memory.
Using the usual stress arguments to launch the docker will pass them to the binary and allows full control over the running options.


Dockerfile:

FROM ubuntu:16.04
RUN apt-get update \
    && apt-get install -y --no-install-recommends stress \
    && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY ./stress-test.sh /usr/src/app/stress-test.sh
ENTRYPOINT ["sh", "./stress-test.sh"]

stress-test.sh:

#!/bin/sh
if [ -z '"$@"' ]
then
    stress --cpu 4 --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1 --timeout 300s
else
    stress "$@"
fi
Docker Pull Command
Owner
pierredadt

Comments (0)