maximum number of server_connections
We have following setup of twemproxy on production: 5 service instances 1 twemproxy instance 4 redis instances Service instances are connected to twemproxy with max_active_connections = 1000. Currently, we are having server_connections: 1000 in the twemproxy configuration. But, as we are having 5 service instances each with max 1000 connections, should we increase the server_connections value to 5000?
@sachinpkale
you can use server_connections = 1 for most cases.
twemproxy will multiplex/pipeline client requests on the only connection. this is as fast as you use more server_connections.
wouldn't server_connections = 1 be bottleneck if there are too many parallel requests?
redis use single process, no matter you use 1 connection or many connections, redis will process it one by one.
so, no bottleneck here.
Then, what is the use of server_connections field in case of redis? is it meant to use only for memcached?
yes, It make sence for memcached,
I can't find more reasons to use server_connections>1
Ok. I will make the change. Thanks for you help.
@idning what 's meaning of "server_connections" for memcached? Twemproxy is also single thread.
@xinyu7git
twemproxy is single thread. but server_connections are meaningful for memcached. because memcached is multi threaded for read(in different slab)
so.
- client A request large data set for memcached A
- client B request large data set for memcached A
in server_connections == 1, client B should wait for finishing Task A. but server_connections > 1, client B can work with memcached A
nobody reads docs anymore https://github.com/twitter/twemproxy/blob/master/notes/recommendation.md#server_connections--1