[转]linux进程的最大文件数
来源:互联网 发布:mac 终端设置时间 编辑:程序博客网 时间:2024/05/16 07:34
因为最近项目上线,要求服务器支持10万并发的socket长连接,所以要改动Linux的一些配置,其中包括每个进程的能打开的最大句柄数,最大线程数,以及每个线程的堆栈大小等,下面这篇文章讲了如何修改系统的进程最大打开句柄数,文章有点老了,但质量很高。
How to increase file descriptors max limit on Linux
Today my DBA reported that the server she was working on was spitting out “too many open files” errors and no new processes could be started.
This is a common problem with DB servers with heavy transactions. In my environment there are 6 DB instances running on the server. No quite the optimized setup I would say.
The fix was to increase the total file descriptors kernel parameter count in the /etc/sysctl.conf file. I doubled my limit from 8192 to 16384.
The walk through,
1. Find out what the current open file descriptor limit is.
(下面这里,我们的服务器查询的数字是160万多,哈哈)
~# more /proc/sys/fs/file-max~# 8192
or
~# sysctl -a | grep fs.file-max~# fs.file-max = 8192
2. View how many open file descriptors are currently being used.
~# more /proc/sys/fs/file-nr~# 8191
3. View how many files are open. The number returned might defer as 1 file descriptor can have multiple open files attached to it.
~# lsof | wc -l~# 10325
4. Edit the kernel paramneter file /etc/sysctl.conf and add line “fs.file-max=[new value]” to it.
~# vi /etc/sysctl.conffs.file-max = 331287
5. Apply the changes.
~# sysctl -p~# fs.file-max = 331287
Problem fixed.
- [转]linux进程的最大文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux下进程的最大线程数、进程最大数、进程打开的文件数
- linux 修改最大文件数,进程数
- LInux 设置 单个进程打开最大的文件数
- 解除 Linux 系统的最大进程数和最大文件打开数限制
- 提高linux对最大进程数和最大打开文件描述符数的限制
- Linux下MySQL启动失败
- 一个中兴的面试题,输入两个数n和m,从数列1,2,3……n中随意取几个数,使其和等于m,要求将其中所有组合列出来编程求解(c语言递归函数分解法)
- 用QRCode生成带有中间logo图的二维码
- android自定义view-绘制顺序及相关原理
- Spring3.0和3.1新定时任务节点
- [转]linux进程的最大文件数
- TabHost的使用
- jpa 由数据库反向生成实体
- C++中析构函数需要定义成虚函数的原因
- 圣诞节“马上有对象” 男士求爱成功率高达55%
- weak alias
- 从QQ网站中提取的纯JS省市区三级联动
- 黑马程序员_HTML中CSS使用的几种方法
- Oracle导出存储过程