i have a mongodb container that can be created using the following command:
docker run --ulimit nofile=64000:64000 -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=password -p 27017:27017 --name test-mongo mongo
I’m able to connect to mongodb without problems but every time i issue many concurrent requests i get the error “connection refused”. While it is still possible to connect to the container using “docker exec” the port is no longer visible from host using netstat.
I have tested the setup on 2 more computers running ubuntu 18.04 and the issue is not present on those. To complicate matters further, when the mongo container is created together with mongo-express using docker-compose file, mongo-express is able to access mongodb even after the port disappears from the host machine.
I have a feeling the problem is with my linux host but i can’t figure out the problem.