linux修改open files
linux系统默认的open files 为1024 ,如果程序报错 too many open files错误,就是因为open files 数目不够,需要修改ulimit 和file-max file-max的含义。man proc,可得到file-max的描述: /proc/sys/fs/file-maxThis file defines a system-wide limit on the number of open files for all processes. (Seealso setrlimit(2), which can be used by a process to set the per-process limit,RLIMIT_NOFILE, on the number of files it may open.) If you get lots of error messagesabout running out of file handles, try increasing this value:即file-max是设置 系统所有进程一共可以打开的文件数量 。同时一些程序可以通过setrlimit调用,设置每个进程的限制。如果得到大量使用完文件句柄的错误信息,是应该增加这个值。也就是说,这项参数是系统级别的。 ulimit Provides