antirez/redis — Issue #356: server.maxclients could be minus!
Author: quiver
Created: 2012-02-25 05:00:54+00:00
State: open

branch : unstable
When ulimit is below 32, maxclients becomes minus, because 32 fds are reserved for redis internal:

$ ulimit -n 16 # I won't do this in the production!
$ ./redis-server
...
Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to -16.

---

If there aren't enough fds available, you could :
a) warn that at the startup and shut the system down
b) optimistically set the max client value and lazily allocate file descriptors
c) or something else?