Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use a connection pool for the SimpleHttpClient #2817

Merged
merged 2 commits into from
Jan 31, 2018
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jan 20, 2018

In particular I hope this will help the pusher, which makes many requests to
sygnal, and is currently negotiating SSL for each one.

In particular I hope this will help the pusher, which makes many requests to
sygnal, and is currently negotiating SSL for each one.
@richvdh
Copy link
Member Author

richvdh commented Jan 21, 2018

retest this please

# the pusher makes lots of concurrent SSL connections to sygnal, and
# tends to do so in batches, so we need to allow the pool to keep lots
# of idle connections around.
pool.maxPersistentPerHost = max((100 * CACHE_SIZE_FACTOR, 5))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although a 100 connections per host seems a bit overkill for a pool to have tbh. I'm not sure whether its worth making this configurable via CACHE_SIZE_FACTOR to be honest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the point is that the pusher is a bit silly and needs that many connections, and so we may as well keep them around?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the point is as described in the comments: yes it needs that many connections, and if we don't keep them around we end up killing ourselves with ssl nego.

using CACHE_SIZE_FACTOR was a crude hack to make it pool 1000 connections on matrix.org, and fewer on smaller homeservers.

@richvdh richvdh merged commit 421d68c into develop Jan 31, 2018
@richvdh richvdh deleted the rav/http_conn_pool branch January 31, 2018 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants