antirez/redis — Issue #246: ulimit -f 10, maxclients 0
Author: karpa13a
Created: 2011-12-14 03:01:29+00:00
State: open

with default ulimits, on most linuxes, there is ulimit on open files 1024
when 1k+ clients connected, redis get stuck like:

```
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
epoll_wait(3, {{EPOLLIN, {u32=4, u64=4}}}, 10240, 88) = 1
accept(4, 0x7fff9864c840, [883955190649061392]) = -1 EMFILE (Too many open files)
open("/var/log/redis/redis.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EMFILE (Too many open files)
```

and eats 100% cpu.

mb need to check on startup open files limit and set max clients?

sry for bad eng.