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

Enable mysql,opentsdb, postgre, http tcp no_delay by default #2528

Closed
WenyXu opened this issue Oct 5, 2023 · 1 comment · Fixed by #2530
Closed

Enable mysql,opentsdb, postgre, http tcp no_delay by default #2528

WenyXu opened this issue Oct 5, 2023 · 1 comment · Fixed by #2530
Labels
C-enhancement Category Enhancements

Comments

@WenyXu
Copy link
Member

WenyXu commented Oct 5, 2023

What type of enhancement is this?

Performance

What does the enhancement do?

As mentioned in #2527, Enable Tcp no_delay is faster ~100x than disable.

stream.for_each(move |stream| {
let io_runtime = io_runtime.clone();
let query_handler = query_handler.clone();
let shutdown = Shutdown::new(notify_shutdown.subscribe());
async move {
match stream {
Ok(stream) => {
let connection = Connection::new(stream);
let mut handler = Handler::new(query_handler, connection, shutdown);
let _handle = io_runtime.spawn(async move {
if let Err(e) = handler.run().await {
error!(e; "Unexpected error when handling OpenTSDB connection");
}
});
}
Err(error) => error!("Broken pipe: {}", error), // IoError doesn't impl ErrorExt.
};
}
})
}
}

Consider calling set_nodelay on TcpStream as did in AddrIncoming

Implementation challenges

No response

@WenyXu WenyXu added the C-enhancement Category Enhancements label Oct 5, 2023
@WenyXu WenyXu changed the title Benchmark TcpIncoming and TcpListenerStream + tokio::net::TcpListener Enable mysql,opentsdb, postgre tcp no_delay by default Oct 5, 2023
@WenyXu WenyXu changed the title Enable mysql,opentsdb, postgre tcp no_delay by default Enable mysql,opentsdb, postgre, http tcp no_delay by default Oct 5, 2023
@sunng87
Copy link
Member

sunng87 commented Oct 7, 2023

tcp_nodelay is enabled in postgres by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants