dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

introduce maxclients flag

Open romange opened this issue 2 years ago • 2 comments

DragonflyDB should be able to protect itself from opening too many connections on the primary port. Otherwise, it will risk reaching max number of open files.

Dragonfly can support a high number by default, I would say 64k is ok as a default for the flag. Redis sets it as 1000: https://github.com/redis/redis/blob/6bf9b144ef722fb301c065125a6bf6cd385841bf/src/config.c#L3188

Also, we should provide a friendly warning on startup if max files ulimit is lower than maxclients - see https://github.com/redis/redis/blob/6bf9b144ef722fb301c065125a6bf6cd385841bf/src/server.c#L2278 and https://github.com/redis/redis/blob/6bf9b144ef722fb301c065125a6bf6cd385841bf/src/config.c#L2539 for example

romange avatar Jun 30 '23 00:06 romange

@ashotland @Pothulapati I suggest tracking connection count metrics in our monitoring dashboards. Also, pls create a follow-up issue - we should configure dragonfly by setting this TBD flag according to the instance memory.

romange avatar Jun 30 '23 00:06 romange

Connection count is already part of the dashboard.

Created controlplane issue.

ashotland avatar Jul 02 '23 08:07 ashotland

@royjacobson Note: We will need to support setting this flag from config set command

adiholden avatar Aug 01 '23 14:08 adiholden