Skip to content

improve router docker debug image#2142

Merged
garypen merged 4 commits intodevfrom
garypen/2135-debug-docker
Nov 24, 2022
Merged

improve router docker debug image#2142
garypen merged 4 commits intodevfrom
garypen/2135-debug-docker

Conversation

@garypen
Copy link
Contributor

@garypen garypen commented Nov 22, 2022

fixes: #2135
fixes: #2145

This PR repurposes the -debug image to make it the basis for a memory tracking image which we can use for investigating router memory issues via heaptrack. (https://github.com/KDE/heaptrack)

The PR is a breaking change because it now automatically starts the router under the control of heaptrack. Technically, it's not really a breaking change and it's certainly not an API change, but I really want to draw people's attention to the fact that the debug image will now execute a lot slower than the non-debug image and use a lot more memory (to track memory with...).

I've updated the docker documentation to show how to mount a local directory to store the heaptrack data. I haven't updated the kubernetes docs, because we don't go into that level of detail and we assume that a kubernetes devops person would know how to allocate and mount a PVC.

fixes: #2135

This PR repurposes the -debug image to make it the basis for a memory
tracking image which we can use for investigating router memory issues
via heaptrack. (https://github.com/KDE/heaptrack)

The PR is a *breaking* change because it now automatically starts the
router under the control of heaptrack. Technically, it's not really a
breaking change and it's certainly not an API change, but I really want
to draw people's attention to the fact that the debug image will now
execute a lot slower than the non-debug image and use a lot more memory
(to track memory with...).

I've updated the docker documentation to show how to mount a local
directory to store the heaptrack data. I haven't updated the kubernetes
docs, because we don't go into that level of detail and we assume that a
kubernetes devops person would know how to allocate and mount a PVC.
@garypen garypen requested a review from a team November 22, 2022 14:55
@garypen garypen self-assigned this Nov 22, 2022
@garypen garypen requested review from BrynCooke, Geal and o0Ignition0o and removed request for a team November 22, 2022 14:58
RUN rm -rf /var/lib/apt/lists/*

# Run the Router downloader which puts Router into current working directory
RUN curl -sSL https://router.apollo.dev/download/nix/${ROUTER_RELEASE}/ | sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the router binary that is used here will be without debug symbols, right? Will heaptrack be able to display enough information?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You get the output we were looking at this morning. Things are mangled but you can roughly work out what is happening. I do think we can improve this further down the line, this is a step along the way.

Copy link
Contributor

@BrynCooke BrynCooke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a go looks great:

heaptrack stats:
	allocations:          	2036
	leaked allocations:   	202
	temporary allocations:	203
Heaptrack finished! Now run the following to investigate the data:

  heaptrack --analyze "/dist/data/router_heaptrack.gz"

@garypen garypen merged commit a4f0cdf into dev Nov 24, 2022
@garypen garypen deleted the garypen/2135-debug-docker branch November 24, 2022 14:21
garypen pushed a commit that referenced this pull request Nov 30, 2022
fixes: #2135
fixes: #2145 

This PR repurposes the -debug image to make it the basis for a memory
tracking image which we can use for investigating router memory issues
via heaptrack. (https://github.com/KDE/heaptrack)

The PR is a *breaking* change because it now automatically starts the
router under the control of heaptrack. Technically, it's not really a
breaking change and it's certainly not an API change, but I really want
to draw people's attention to the fact that the debug image will now
execute a lot slower than the non-debug image and use a lot more memory
(to track memory with...).

I've updated the docker documentation to show how to mount a local
directory to store the heaptrack data. I haven't updated the kubernetes
docs, because we don't go into that level of detail and we assume that a
kubernetes devops person would know how to allocate and mount a PVC.
@BrynCooke BrynCooke added this to the v1.5.0 milestone Dec 3, 2022
@garypen garypen added this to the v1.5.0 milestone Dec 5, 2022
@BrynCooke BrynCooke modified the milestone: v1.5.0 Dec 5, 2022
@BrynCooke BrynCooke mentioned this pull request Dec 5, 2022
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.

ca-certificates issue on the 1.4.0 version's docker image improve router docker debug image

4 participants