Concurrent connections to Redis reset by peer

Expected behavior

Should be able to handle multiple concurrent connections

Actual behavior

Connection gets reset

Information

Running the redis-benchmark utility ends in a Error: Server closed the connection message. There are no problems when only connecting with a single client. This issues was also seen with own code, which gives me errors like:

read tcp 127.0.0.1:53334->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53328->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53331->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53330->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53332->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53329->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53327->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53324->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53335->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53323->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53325->127.0.0.1:6379: read: connection reset by peer
read tcp 127.0.0.1:53326->127.0.0.1:6379: read: connection reset by peer

( there are multiple errors due to the multiple connections )
I can post logs if they are requested.

OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta13
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Your unique id is: C5ED8CB3-C20F-445D-922D-3919E887011F
Please quote this in all correspondence.

Steps to reproduce the behavior

  1. Start Docker for Mac
  2. docker run -p 6379:6379 -d redis
  3. brew install redis
  4. redis-benchmark
  5. Result: Error: Server closed the connection

Running redis-benchmark -c 1 doesn’t fail.

I am seeing this in a related functionality in my own environment. My issue is the same but not a redis image issue. This appears to occur when connecting to a container from outside of the docker vm and one of two situations occur:

  1. I try to have more then ~500 concurrent connections open.

  2. I attempt to near simultaneously(<100 microseconds) open more then 5 connections to my container.

This has made applying load to my application for profiling purposes very, very difficult.