increase te max number of fds in /proc/sys/fs/file-max and in ulimit -n
[root@brinquedo /root]# cat ~acme/max_sockets.c
#include <sys/types.h>
#include <sys/socket.h>
int main(void)
{
int nr_sockets = 0;
while(socket(PF_INET, SOCK_STREAM, 0) > 0)
++nr_sockets;
printf("nr_sockets=%d\n", nr_sockets);
return 0;
}
[root@brinquedo /root]# ulimit -n
4096
[root@brinquedo /root]# ./max_sockets
nr_sockets=4093
[root@brinquedo /root]# ulimit -n 8192
[root@brinquedo /root]# ./max_sockets
nr_sockets=7600
[root@brinquedo /root]# ulimit -n 16384
[root@brinquedo /root]# ./max_sockets
nr_sockets=7601
[root@brinquedo /root]# cat /proc/sys/fs/file-max
8192
[root@brinquedo /root]# echo 20000 > /proc/sys/fs/file-max
[root@brinquedo /root]# ./max_sockets
nr_sockets=16381
- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/