Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Client slow on 2 commands or more (probably timeout) #51

Closed
Khazrak opened this issue May 24, 2016 · 7 comments
Closed

Client slow on 2 commands or more (probably timeout) #51

Khazrak opened this issue May 24, 2016 · 7 comments
Assignees

Comments

@Khazrak
Copy link
Contributor

Khazrak commented May 24, 2016

If you run several commands on the client (one after the other) it is really slow. Every command after the first takes 30s (a timeout?). If you close and open the client between every command then this does not occur.

I attached a junit test that creates a container, starts it, stops it and removes it. One test with closing the client between every command (fast) and one test without it (slow), the speeds are:
fast: 1s 121ms
slow: 1m 30s 550ms

Speed.txt

@iocanel iocanel self-assigned this May 24, 2016
@iocanel
Copy link
Member

iocanel commented May 24, 2016

While I am still looking at #50 could you please try without using the a unix socket and see if it makes any difference so that we can narrow it down a little bit?

@rhuss
Copy link
Contributor

rhuss commented May 24, 2016

@Khazrak are you using a Linux docker daemon or the new Docker for Mac over the unix socket ?

@rhuss
Copy link
Contributor

rhuss commented May 24, 2016

I could reproduce it on Docker for Mac which uses a Unix Socket as well. Breaking while debugging shows that the test hangs in a read on the Unix Socket. I set a breakpoint on IOExceptions and saw that the UnixSocket read throws an exception like:

Resource temporarily unavailable at Socket[addr=0.0.0.0/0.0.0.0,port=0,localport=0][fd=java.io.FileDescriptor@1880249c; file=/Users/roland/Library/Containers/com.docker.docker/Data/s60; connected=true; bound=false]

@Khazrak
Copy link
Contributor Author

Khazrak commented May 24, 2016

I'm using Linux docker daemon (Ubuntu 16.04 also tested on Ubuntu 14.04).
I also tested on the tcp insted of unix socket and can verify that the problem is contained in the unix socker (tcp works fast)

rhuss added a commit to rhuss/docker-client that referenced this issue May 24, 2016
Adding jnr-unixsocket as alternative unix socket implementation which can be selected with 'withUseJnrUnixSocket()' config option. With this alternative there seems to be no performance issues anymore. Jnr-unixsockets are enabled by default now but can be switched off with this config option.
rhuss added a commit to rhuss/docker-client that referenced this issue May 24, 2016
Adding jnr-unixsocket as alternative unix socket implementation which can be selected with 'withUseJnrUnixSocket()' config option. With this alternative there seems to be no performance issues anymore. Jnr-unixsockets are enabled by default now but can be switched off with this config option.
rhuss added a commit to rhuss/docker-client that referenced this issue May 24, 2016
Adding jnr-unixsocket as alternative unix socket implementation which can be selected with 'withUseJnrUnixSocket()' config option. With this alternative there seems to be no performance issues anymore. Jnr-unixsockets are enabled by default now but can be switched off with this config option.
@iocanel
Copy link
Member

iocanel commented May 24, 2016

So with @rhuss fix it should be working ok now.

@Khazrak do you want to give it a spin?

@Khazrak
Copy link
Contributor Author

Khazrak commented May 24, 2016

Tried it and it worked great

@iocanel
Copy link
Member

iocanel commented May 24, 2016

perfect!

@iocanel iocanel closed this as completed May 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants