Tuesday, August 22, 2017

Simulate high memory usage (in a container)

I wanted a way to simulate high memory usage to test prometheus alerting rules I had defined for high memory usage of containers.

This stackoverflow link shows several ways to simulate high memory usage. I like the following most:


sh -c "MEMBLOB=\$(dd if=/dev/urandom bs=1MB count=256) ; read"

This will increase the memory usage of the shell by 256MB.




No comments:

Post a Comment