Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lower latency / boot times for light apps? #497

Open
kodonnell opened this issue Sep 11, 2019 · 4 comments

Comments

@kodonnell
Copy link

commented Sep 11, 2019

Does anyone else see a similar latency to below? I've tested on two machines, and this was the faster.

$ time docker run --rm -it --pid host jess/htop echo hi
hi

real    0m1.177s
user    0m0.054s
sys     0m0.014s

I'm interested in running 'light' applications like htop, which I use frequently and a 1 second latency could just add that little bit of friction to my day. So I'm interested in getting this number down a bit. And it'd obviously be handy for the existing stuff in this repo. But before I really go down a rabbit hole (e.g. different container runtimes?), I'd like to check it's not just me, or this isn't a dumb question (sorry, not much docker experience).

FYI other things I played with (which I might as well add here):

  • --network=none shaves off 0.2s and may be applicable.
  • starting the container (not running htop) and then docker exec -it <container name> htop is more like 0.4s. There just seems to a lot of overhead in spinning up the container etc.
  • in this particular case, it may be fine to have the container running all the time, and docker attach which is effectively instant.
@issue-label-bot

This comment has been minimized.

Copy link

commented Sep 11, 2019

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.54. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@tianon

This comment has been minimized.

Copy link

commented Sep 11, 2019

This seems like more of a general Docker question (and is probably of interest to a larger group); have you tried the Docker Community Forums, the Docker Community Slack, or Stack Overflow?

@kodonnell

This comment has been minimized.

Copy link
Author

commented Sep 12, 2019

@tianon - I'm more interested in the specific objective of this repo (e.g. using containers for sandboxing [potentially lightweight] apps where I may want low latency). I guess the distinction is that I don't actually mind whether it's Docker or not. This is also just a general question here to see if it's a common problem, and whether there's an obvious solution - if not, it may mean resorting to some of the sources you mentioned.

Also - I figure it's probably a useful thing to leave in this repo for others who may have similar "should I try this for application X?" questions. (I couldn't find anything on it when I looked.) Happy to close if you don't think it's productive.

@kodonnell

This comment has been minimized.

Copy link
Author

commented Sep 12, 2019

Just tested and runc seems to work and be about 6 times faster (boot) in this case. I have no idea how runc compares and whether it'd work for e.g. non-trivial containers like the chrome one here, but it's interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.