Skip to content

Commit eb48ad5

Browse files
committed
added performances page
1 parent d135bd3 commit eb48ad5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/site/apt/performances.apt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
------
2+
Async Http Client - Limiting the number of connections to improve raw performance
3+
------
4+
Jeanfrancois Arcand
5+
------
6+
2012
7+
8+
Limiting the number of connections to improve raw performance
9+
10+
By default the library uses a connection pool and re-use connections as needed. It is important to not let the
11+
connection pool grow too large as it takes resources in memory. One way consist of setting the maximum number of
12+
connection per host or in total:
13+
14+
+-----+
15+
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
16+
.setMaximumConnectionsPerHost(10)
17+
.setMaximumConnectionsTotal(100)
18+
.build();
19+
AsyncHttpClient c = new AsyncHttpClient(config);
20+
+-----+
21+
22+
There is no magic number, so you will need to try it and decide which one gives the best result.

0 commit comments

Comments
 (0)