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
Add production checklist about maxNumEventLoopsPerEndpoint
#5297
Conversation
@@ -96,3 +96,20 @@ See [Using CircuitBreaker with non-Armeria client](/docs/client-circuit-breaker# | |||
ClientBuilder cb = Clients.builder(...); | |||
cb.factory(cf); | |||
``` | |||
|
|||
- Increase `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` when your clients send requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about explaining the effect of increasing the number of event loops?
- Increase `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` when your clients send requests | |
- Increase `<type://ClientFactoryBuilder.maxNumEventLoopsPerEndpoint(int)>` and | |
`<type://ClientFactoryBuilder.maxNumEventLoopsPerHttp1Endpoint(int)>` when a client | |
needs to send a large number of requests to a specific endpoint. The client will | |
assign more CPU resources and create more connections by increasing the number of | |
event loops. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ghkim3221 ! 🙇 👍 🙇
import com.linecorp.armeria.client.ClientFactory; | ||
import com.linecorp.armeria.client.ClientFactoryBuilder; | ||
|
||
ClientFactoryBuilder cfb = new ClientFactoryBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default constructor isn't public (optionally it would be great if the other examples in this page are updated)
ClientFactoryBuilder cfb = new ClientFactoryBuilder(); | |
ClientFactoryBuilder cfb = ClientFactory.builder(); |
- Increase `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` when your clients send requests | ||
to a small number of servers. As an Endpoint uses a single event loop, there may be a bottleneck. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What do you think of adding
Consider
since performance may not always be better. - What do you think of conveying why there is a bottleneck?
- Increase `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` when your clients send requests | |
to a small number of servers. As an Endpoint uses a single event loop, there may be a bottleneck. | |
- Consider increasing `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` for better request throughput. Doing so may increase performance at the cost of opening more connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this comment late #5297 (comment) .
I think using this comment is fine, but still I think adding "Consider" is a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, @ghkim3221!
Co-authored-by: minux <songmw725@gmail.com>
Co-authored-by: minux <songmw725@gmail.com>
Thank you @minwoox! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Motivation: Using `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint` with the default value (1) may be a bottleneck when a client sends lots of requests to a small number of servers because an `Endpoint` uses a single event loop. Modifications: - Add a production checklist about `maxNumEventLoopsPerEndpoint` and `maxNumEventLoopsPerHttp1Endpoint`. Result: - Users would recognize the bottleneck problem earlier.
Motivation:
Using
maxNumEventLoopsPerEndpoint
andmaxNumEventLoopsPerHttp1Endpoint
with the default value (1) may be a bottleneck when a client sends lots of requests to a small number of servers because anEndpoint
uses a single event loop.Modifications:
maxNumEventLoopsPerEndpoint
andmaxNumEventLoopsPerHttp1Endpoint
.Result: