Skip to content

Use graphdb.Walk with depth=1 in /containers - #10105

Merged
crosbymichael merged 3 commits into
moby:masterfrom
LK4D4:remove_tons_of_names
Feb 6, 2015
Merged

crosbymichael merged 3 commits into
moby:masterfrom
LK4D4:remove_tons_of_names

Conversation

@LK4D4

@LK4D4 LK4D4 commented Jan 14, 2015

Copy link
Copy Markdown
Contributor

I don't think that it was very useful feature in current implementation,
but when you have a lot of links - your daemon became unusable because
on first call of /containers global graphdb lock will be acquired and it
can take a lot of time: 30m for 15 containers linked to each other.

Fixes #9967

Also note that this was undocumented feature.

ping @aanand @vieux @tbatchelli

@jessfraz

Copy link
Copy Markdown
Contributor

+1 -9 😻

@tiborvass

Copy link
Copy Markdown
Contributor

~~ This is a breaking change~~

$ docker run --name c1 -d busybox top
fd25de7d6bc1
$ docker run --link c1:c1 --name c2 -d busybox top
1fff85f22c7f
$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
1fff85f22c7f        busybox:latest      "top"               3 seconds ago       Up 2 seconds                            c2
fd25de7d6bc1        busybox:latest      "top"               44 seconds ago      Up 43 seconds                           c1

Names column doesn't have the linked names anymore, and I'm sure people are relying on this.

I don't know what the right solution is though :(

EDIT: Apparently, this behavior was already in 1.4

@jessfraz

Copy link
Copy Markdown
Contributor

whoa why is there no test for that?

@vieux

vieux commented Jan 15, 2015

Copy link
Copy Markdown
Contributor

@tiborvass I too recall this, but it's currently the same in master

@tiborvass

Copy link
Copy Markdown
Contributor

@vieux you are right, I can confirm it's the same in master. In fact it's the same in 1.4.1 :(

@vieux

vieux commented Jan 15, 2015

Copy link
Copy Markdown
Contributor

On the bright side, nobody noticed, to nobody was using it :D

@tiborvass

Copy link
Copy Markdown
Contributor

@vieux is it the case for the API as well? And if we want to remove it because it was undocumented and no one complained it was removed, I would still wait one more release for this, just to be sure.

@vieux

vieux commented Jan 15, 2015

Copy link
Copy Markdown
Contributor

@tiborvass I was kinda joking, I think we should reintroduce it. at least with docker ps -a

@jessfraz

Copy link
Copy Markdown
Contributor

we should write a failing test then do a git bisect FUN FUN FUN

@LK4D4

LK4D4 commented Jan 15, 2015

Copy link
Copy Markdown
Contributor Author

How it was before? I think I can add first-level linked names with Walk + depth==1. Also I think that this all was undocumented, unused and confusing as hell :)

@vieux

vieux commented Jan 15, 2015

Copy link
Copy Markdown
Contributor

@LK4D4 it is documented

Look for Running docker ps showing 2 linked containers. in https://docs.docker.com/reference/commandline/cli/

That's why the column is NAMES in docker ps and not NAME

@tbatchelli

Copy link
Copy Markdown

Also, this has this 'feature' has the potential to bring docker to an unrecoverable state, as #9967 shows=

@vieux

vieux commented Jan 15, 2015

Copy link
Copy Markdown
Contributor

that's also why the names are in the graphdb instead of just the container,json.

They can change with links

@SvenDowideit

Copy link
Copy Markdown
Contributor

please make sure the docs get corrected to what is actually happening

@LK4D4

LK4D4 commented Jan 15, 2015

Copy link
Copy Markdown
Contributor Author

Yeah, I know why we using graphdb, but it seems that there was some idea behind this, which totally lost now. Walk with full depth used only in /containers, which seems weird.

@LK4D4 LK4D4 changed the title Remove graphdb.Walk from /containers Use graphdb.Walk with depth=1 in /containers Jan 15, 2015
@LK4D4

LK4D4 commented Jan 15, 2015

Copy link
Copy Markdown
Contributor Author

@tiborvass @SvenDowideit @vieux take another look, now this names shows with --no-trunc. I think all names only with --no-trunc was introduced by @crosbymichael in October and I think that was good change.

@cpuguy83

Copy link
Copy Markdown
Member

See #8489 and the subsequent #8505 re: missing link names

@LK4D4

LK4D4 commented Jan 15, 2015

Copy link
Copy Markdown
Contributor Author

@cpuguy83 Yup, thanks that you found it.

@jessfraz

Copy link
Copy Markdown
Contributor

LGTM

@tiborvass

Copy link
Copy Markdown
Contributor

I would like to make sure we're not breaking the API (sorry)

@LK4D4

LK4D4 commented Jan 20, 2015

Copy link
Copy Markdown
Contributor Author

@tiborvass It is breaking api in good and useful way (not best because someone want see links in --no-trunc).

@tbatchelli

Copy link
Copy Markdown

Just adding user feedback, monitoring tools like DataDog will call docker ps every few seconds, so I think it might be worth to break the API if it comes down to it.

 

Antoni Batchelli 

On January 20, 2015 at 12:55:56 PM, Alexander Morozov ([email protected]) wrote:

@tiborvass It is breaking api in good and useful way (not best because someone want see links in --no-trunc).

—
Reply to this email directly or view it on GitHub.

@SvenDowideit

Copy link
Copy Markdown
Contributor

Doc LGTM - @fredlf @jamtur01

@jamtur01

Copy link
Copy Markdown
Contributor

Docs LGTM

LK4D4 added 2 commits February 6, 2015 14:04
I don't think that it was very useful feature in current implementation,
but when you have a lot of links - your daemon became unusable because
on first call of /containers global graphdb lock will be acquired and it
can take a lot of time: 30m for 15 containers linked to each other.

Links names can be seen with `--no-trunc`, but I think it's useless :)

Fixes #9967

Signed-off-by: Alexander Morozov <[email protected]>
Signed-off-by: Alexander Morozov <[email protected]>
@crosbymichael crosbymichael added this to the 1.6.0 milestone Feb 6, 2015
@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Feb 6, 2015
Use graphdb.Walk with depth=1 in /containers
@crosbymichael
crosbymichael merged commit 9d140fe into moby:master Feb 6, 2015
@LK4D4
LK4D4 deleted the remove_tons_of_names branch February 6, 2015 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker PS exponentially slower with number of links in the system

9 participants