S3 bug demo
A demo of the bug described in this blog post.
- Make a new virtualenv and activate it
pip install -r requirements.txt
- Start a moto server in the background:
moto_server s3bucket_path &. Moto is a library that implements a fake s3 for use in testing.
python create_test_object.py. This will write a gigabyte of random data to a test key in the moto s3 (in memory, so make sure you have a least a GB of memory available)
python app.py &to start the flask server in the background.
curl http://127.0.0.1:5001/test > /dev/nullto retrieve the GB of random test data and send it to /dev/null. Everything will be fine
curl http://127.0.0.1:5001/test | head -c 10and watch the memory usage of the server balloon to roughly a gigabyte just after the command returns.