-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Minimum number of connections #8440
Comments
Keeping a minimum number of connections open is a feature that is currently not present. However, the use case you describe would not have any problem, as during peak load no time is wasted creating new connections: the 2 that you have will be busy and will never timeout. If you are so idle that all connections timed out, typically you don't care if your request took 1-2 more network roundtrips to complete a request/response, as we are typically talking few hundreds of milliseconds (or less) only. If you have a more compelling use case I'd like to hear, but seems unnecessary to me. |
Seems like you would need cooperation of all of the network equipment (source machine, destination machine, intermediaries) to not close the connection as well (for a variety of idle timeout related features). That seems like "a big ask" of the network to me. |
hi @sbordet Our use case is related to the spec 5G 29.500 section [5.2.6].
If I understand the spec correctly we can not end up in scenario when we want to send a request using client and all connections have already used all valid StreamID and there is a need to create a new connection. So my idea was to have a second connection ready in stand by and when the first one reaches ~90% of valid StreamsID the second connection takes over, a third one is being created to be a new standby and the first one is left just to handle all pending responses and will timeout as idle after some time. I will be grateful for any hits/ suggestions |
There is a much simpler solution. So you can set it to your 90% of valid stream ids (or less as that number is quite big), and when the usage reaches the max the connection will be closed. |
Thank you for a very fast replay. |
one more comment - I've found something called
Do you think this is something that I could use? |
There is no simultaneous exhaustion. Jetty's connection pool work by default by using the first available connection. When the first is exhausted you may have the second already available, or amortize the creation of the connection over, possibly, 1 billion requests. You may call |
Thank you @sbordet for the suggestion. In the end I've implemented some workaround - we have switched to RoundRobin pool. On top of that I've added an extra thread to the actual pool that runs periodically and checks if |
Great you could make it work. FTR, I still think it's a bit overkill and that the 3GPP specification is too vague about the requirement (and you worry too much after reading the spec), but fine. Feel free to close the issue if it's resolved for you. |
Jetty version
9.4.44.v20210927
Java version
java version "11.0.3" 2019-04-16 LTS
Question
We are using jetty client in our project.
From our customers we have a requirement to keep at least 2 connections up per destination all the time (to not waste time for connection a new connection establishing during load peak).
Is there a way to achieve this with jetty? Something like configurable minimum number of connections that jetty client will always try to keep open (even if they are idle). In case a server closes a connection - a reconnection should happen.
Or maybe you could point me to any documentation around this?
Thank you
The text was updated successfully, but these errors were encountered: