diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-28 16:03:56 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-28 16:03:56 +0100 |
commit | 0f118e55db81dd35193e4c100a6a1a43dd84fd61 (patch) | |
tree | 4464089d80ce51f2bb62d595639f748afaf0c310 /synapse/http/matrixfederationclient.py | |
parent | Merge pull request #167 from matrix-org/erikj/deep_copy_removal (diff) | |
parent | Up maxPersistentPerHost count (diff) | |
download | synapse-0f118e55db81dd35193e4c100a6a1a43dd84fd61.tar.xz |
Merge pull request #168 from matrix-org/erikj/conn_pool
Make HTTP clients use connection pools.
Diffstat (limited to '')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index 6f976d5ce8..44f0b00333 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -16,7 +16,7 @@ from twisted.internet import defer, reactor, protocol from twisted.internet.error import DNSLookupError -from twisted.web.client import readBody, _AgentBase, _URI +from twisted.web.client import readBody, _AgentBase, _URI, HTTPConnectionPool from twisted.web.http_headers import Headers from twisted.web._newclient import ResponseDone @@ -103,7 +103,9 @@ class MatrixFederationHttpClient(object): self.hs = hs self.signing_key = hs.config.signing_key[0] self.server_name = hs.hostname - self.agent = MatrixFederationHttpAgent(reactor) + pool = HTTPConnectionPool(reactor) + pool.maxPersistentPerHost = 10 + self.agent = MatrixFederationHttpAgent(reactor, pool) self.clock = hs.get_clock() self.version_string = hs.version_string |