zoukankan      html  css  js  c++  java
  • too many open file /etc/security/limits.conf

     
    当出现too mang open file 时更改/etc/profile中的ulimit -n 65536 ,查看
     
    然后ssh进去,或者退出之后重新登录使之生效                                
     
     
    limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,而且只针对于单个会话。
      limits.conf的格式如下:
        username|@groupname : type resource limit
        username|@groupname : 设置需要被限制的用户名,组名前面加@和用户名区别。也可以用通配符*来做所有用户的限制。
      type:有 soft,hard 和 -,soft 指的是当前系统生效的设置值。hard 表明系统中所能设定的最大值。soft 的限制不能比har 限制高。用 - 就表明同时设置了 soft 和 hard 的值。
      resource:
      core - 限制内核文件的大小
      date - 最大数据大小
      fsize - 最大文件大小
      memlock - 最大锁定内存地址空间
      nofile - 打开文件的最大数目
      rss - 最大持久设置大小
      stack - 最大栈大小
      cpu - 以分钟为单位的最多 CPU 时间
      noproc - 进程的最大数目
      as - 地址空间限制
      maxlogins - 此用户允许登录的最大数目
      要使 limits.conf 文件配置生效,必须要确保 pam_limits.so 文件被加入到启动文件中。查看 /etc/pam.d/login 文件中有:
      session required /lib/security/pam_limits.so
     
    例如:修改文件描述符大小(65536)
    vi  /etc/security/limits.conf
     
    *                               soft    nofile  65536
    *                               hard    nofile  65536
     
     
     

    本文摘自 “聆听未来” 博客,请务必保留此出处http://kerry.blog.51cto.com/172631/300784

     
     
     
  • 相关阅读:
    LCA + 二分(倍增)
    Educational Codeforces Round 5
    BNU 51276
    POJ 1511
    hdu2121
    最小树形图(朱刘算法)
    Educational Codeforces Round 1(D. Igor In the Museum) (BFS+离线访问)
    Educational Codeforces Round 1(C. Nearest vectors)
    POJ-2785 4 Values whose Sum is 0(折半枚举 sort + 二分)
    POJ 1661Help Jimmy(逆向DP Or 记忆化搜索 Or 最短路径)
  • 原文地址:https://www.cnblogs.com/wangqianqiannb/p/5345028.html
Copyright © 2011-2022 走看看