-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Search before asking
- I searched in the issues and found nothing similar.
Motivation
The Pulsar Admin client uses connection pooling (keep alive) without limiting the number of connections.
When HTTP calls get queued up on the brokers for some reason, the client will keep on opening more connections.
Solution
The AsyncHttpClient used in pulsar-admin-client should be configured to limit the number of connections.
This could happen somewhere here:
Lines 99 to 108 in e3debb9
| DefaultAsyncHttpClientConfig.Builder confBuilder = new DefaultAsyncHttpClientConfig.Builder(); | |
| confBuilder.setUseProxyProperties(true); | |
| confBuilder.setFollowRedirect(true); | |
| confBuilder.setRequestTimeout(conf.getRequestTimeoutMs()); | |
| confBuilder.setConnectTimeout(connectTimeoutMs); | |
| confBuilder.setReadTimeout(readTimeoutMs); | |
| confBuilder.setUserAgent(String.format("Pulsar-Java-v%s", PulsarVersion.getVersion())); | |
| confBuilder.setRequestTimeout(requestTimeoutMs); | |
| confBuilder.setIoThreadsCount(conf.getNumIoThreads()); | |
| confBuilder.setKeepAliveStrategy(new DefaultKeepAliveStrategy() { |
setMaxConnections and setMaxConnectionsPerHost would have to be configured.In addition, it would be useful to use
setPooledConnectionIdleTimeout to set the timeout to 25 seconds so that pooled connections don't exceed timeouts in typical firewall configurations. The default of 60 seconds conflicts with many firewall idle connection defaults.
Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Metadata
Metadata
Assignees
Labels
No labels