“最大打开文件数"工作流程 [英] "Max open files" for working process

查看:13
本文介绍了“最大打开文件数"工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为工作进程增加最大打开文件数"参数?我的意思是这个参数:

Is it possible to increase "Max open files" parameter for working process ? I mean this parameter:

cat /proc/<pid>/limits | grep files

感谢您的建议

推荐答案

作为系统管理员:/etc/security/limits.conf 文件在大多数 Linux 安装中控制它;它允许您设置每个用户的限制.您需要像 myuser - nofile 1000 这样的行.

在进程内:getrlimit 和 setrlimit 调用 控制大多数每个进程的资源分配限制.RLIMIT_NOFILE 控制文件描述符的最大数量.您需要适当的权限才能调用它.

Within a process: The getrlimit and setrlimit calls control most per-process resource allocation limits. RLIMIT_NOFILE controls the maximum number of file descriptors. You will need appropriate permissions to call it.

这篇关于“最大打开文件数"工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆