High CPU when using file watchers and volumes
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, macos, node.js, typescript
- Domain
- infrastructure, performance
Research direction
Reproduce the reported setup using yarnWatch.sh, the node:12.16.1-alpine image, and the /proj volume mount from the provided Docker command. Compare idle and reload CPU usage with the custom image that reportedly has no performance problems, then determine whether the volume configuration accounts for the slowdown and document the result.
Written by the indexing model from the issue text.
Description
My project (A small, ~8 endpoint express app) uses typescript compiler file watching (tsc --watch) and nodemon for local development.
The combination of these two processes running outside of docker, on MacOS, uses approximately 5% of one CPU core when idle, 25% cpu of one core when compiling/reloading, and finishes in approximately 2 seconds.
We've been experimenting with developing inside of Docker, as an alternative to using Node Version Manager and juggling multiple projects with different node versions.
Here is the example script we have been running:
yarnWatch.sh
#!/bin/sh
tsc --watch
nodemon app.js
docker run \
--volume $(pwd):/proj \
--workdir /proj \
--rm \
--publish 3030:3030 \
--detach \
node:12.16.1-alpine scripts/yarnWatch.sh
When running in this way, the hyperkit process idles at 200% CPU (my guess is 100% of two cores), uses 500%cpu when compiling/relaoding, and finishes in 20 seconds.
My hypothesis is this is some sort of bottleneck regarding volumes, as running the app in a custom built image has no performance problems.
- Dominant language
- C
- Stars
- 3.7k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from moby/hyperkit
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
duckdb/duckdb-wasm#2258 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
rofl0r/microsocks#110 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
espressif/esp-aws-iot#261 ·
-
os:linux
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
mpv-player/mpv#18510 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100