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

Investigate file descriptor use with tokio 0.2 #1695

Closed
lukesteensen opened this issue Feb 4, 2020 · 4 comments
Closed

Investigate file descriptor use with tokio 0.2 #1695

lukesteensen opened this issue Feb 4, 2020 · 4 comments
Assignees
Labels
domain: performance Anything related to Vector's performance type: enhancement A value-adding code change that enhances its existing functionality. type: tech debt A code change that does not add user value.

Comments

@lukesteensen
Copy link
Member

As explained in #1142, we want to upgrade our underlying runtime to tokio 0.2 for better performance, more modern interfaces, etc. The tokio-compat runtime gives us an incremental path for that upgrade, so we'd like to use that as a first step.

In some preliminary experiments switching to tokio-compat, @LucioFranco found an issue where the new runtime caused significantly increased use of file descriptors, particularly during test runs. Before we merge any changes to master, we should try to reproduce and measure this effect so we can evaluate its impact both for users and contributors.

Here's a rough plan of attack:

  1. In a branch off of master, do the minimal transition to tokio-compat (see Upgrade to tokio v0.2 and std::future::Future #1142) and get tests passing.
  2. Compare fd use for cargo test --features docker across master and the new branch.
  3. Do some simple manual tests of fd use while running vector normally for short-ish periods of time (e.g. 5-10 mins) to see if there's any evidence of a leak.

Once we have some data to compare, we can evaluate the impact and see how we want to proceed.

@LucioFranco
Copy link
Contributor

And to clarify a few things, I found that when I disabled the tokio 0.2 IO driver that the high fd usage went away. So this would be another area to check.

@LucioFranco
Copy link
Contributor

Another note, one thing I found was if we disabled the io driver here https://github.com/tokio-rs/tokio-compat/blob/master/src/runtime/threadpool/builder.rs#L172 it seemed to fix the issue for me. Leading me to believe this was with the 0.2 io driver. I would suggest cloning tokio-compat locally, and patching it into vector. If you have questions feel free to reach out.

check https://docs.rs/tokio/0.2.11/tokio/runtime/struct.Builder.html#method.enable_io docs and the general tokio 0.2 builder docs.

@binarylogic binarylogic modified the milestones: Improved high concurrency performance, Tech-Debt Payment #1: Move to Tokio 0.3 Feb 22, 2020
@MOZGIII MOZGIII mentioned this issue Feb 25, 2020
7 tasks
@MOZGIII
Copy link
Contributor

MOZGIII commented Feb 28, 2020

Solved as part of #1922 via tokio-rs/tokio-compat#28

@MOZGIII MOZGIII closed this as completed Feb 28, 2020
@binarylogic
Copy link
Contributor

Nice work

@binarylogic binarylogic removed this from the Tech-Debt Payment #1: Move to Tokio 0.2/Futures 0.3 milestone Jul 20, 2020
@binarylogic binarylogic added type: enhancement A value-adding code change that enhances its existing functionality. domain: performance Anything related to Vector's performance and removed type: performance labels Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: performance Anything related to Vector's performance type: enhancement A value-adding code change that enhances its existing functionality. type: tech debt A code change that does not add user value.
Projects
None yet
Development

No branches or pull requests

4 participants