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

Provide ConnectionProvider configuration for limiting the number of the connection pools #3318

Open
violetagg opened this issue Jun 26, 2024 · 6 comments
Labels
help wanted We need contributions on this type/enhancement A general enhancement

Comments

@violetagg
Copy link
Member

violetagg commented Jun 26, 2024

This is a follow up issue for #3315 (comment)

@violetagg violetagg added type/enhancement A general enhancement status/need-triage A new issue that still need to be evaluated as a whole labels Jun 26, 2024
@violetagg violetagg changed the title Provide a confi Provide a configuration in ConnectionProvider for limiting the number of the connection pools Jun 26, 2024
@violetagg violetagg removed status/need-triage A new issue that still need to be evaluated as a whole labels Jun 26, 2024
@violetagg violetagg modified the milestone: General Backlog Jun 26, 2024
@violetagg violetagg added help wanted We need contributions on this labels Jun 26, 2024
@violetagg violetagg changed the title Provide a configuration in ConnectionProvider for limiting the number of the connection pools Provide ConnectionProvider configuration for limiting the number of the connection pools Jun 26, 2024
@cloudzhou
Copy link

@violetagg when read from

https://projectreactor.io/docs/netty/release/api/reactor/netty/resources/ConnectionProvider.htm
Build a ConnectionProvider to cache and reuse a fixed maximum number of Connection.

but here https://projectreactor.io/docs/netty/1.2.0-M4/reference/tcp-client.html
Connections used by the TcpClient are never returned to the pool, but closed. When a connection is closed, a slot is freed in the pool and thus a new connection can be opened when needed.

so, how can ConnectionProvider reuse connection?
any one can help?

@violetagg
Copy link
Member Author

@cloudzhou for TCP client you cannot reuse the connections, the connection pool is used to limit the number of the connections that you can open.

@cloudzhou
Copy link

cloudzhou commented Aug 16, 2024

so confused about that, TCP client and reuse connections is so common and important
the default implement need to pooled and reuse connections as base usage

@violetagg
Copy link
Member Author

@cloudzhou as we pointed in the documentation
https://projectreactor.io/docs/netty/1.2.0-M4/reference/tcp-client.html#connection-pool
we don't know what protocol is used on top of TCP and whether the connections are recycled and ready to be reused.

@cloudzhou
Copy link

so is there a recommend way to pooled and reuse the connection?
some document or open source code demo?

@violetagg
Copy link
Member Author

violetagg commented Aug 16, 2024

@cloudzhou Take a look at R2DBC pool https://github.com/r2dbc/r2dbc-pool (it uses TcpClient)

If you have more questions let's continue on Gitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We need contributions on this type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants