Example code to demonstrate an issue with Docker for Windows under high concurrent load
The code is written in .Net and requires .Net Core, the easiest way is just to intsall the command line tools from:
Of course, if you have Visual Studio installed, this will also run it just fine.
- Clone repository
- Open terminal from root of repository
- Start redis:
docker-compose up -d
- Run program:
dotnet run --project DockrBomb
- Enter number of threads to run (try with 500) and push enter
- Let it run, until all
.
have been replaced withx
indicating all threads have died
When all the connections die simultaneously it seems to be because of an issue connecting to the docker container. All further attempts will fail (which can be seen by trying to run the program again with any number of threads), only a restart of Docker fixes it.
It is also not possible to restart the container, as an error will occur when Docker tries to bind the exposed port on the host, although the port is not taken.
ERROR: for redis Cannot start service redis: driver failed programming external connectivity on endpoint dockerbomb_redis_1 (655ca14291eb9b761ee5ba18d512f5f4b3b59324c3bbe347d28a5980f0be9119): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:6379:tcp:172.19.0.2:6379: input/output error
ERROR: No containers to start