免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 906 | 回复: 0
打印 上一主题 下一主题

部门网站维护记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-12 13:41 |只看该作者 |倒序浏览

                20060111
www.justgo.com.cn
无法登陆
解决方法之一:
1 # echo 2048 > /proc/sys/fs/file-max
  将句柄最大值赋为:2048
2 编辑 /etc/security/limits.conf
  在 #  后加入一行:* -nofile 2048
3 # ulimit -n
  如果显示的值为:2048 说明修改成功
  重启系统 生效
  具体文档如下:
Resolution:
The current setting for maximum number of open files can be viewed with the command:
ulimit -n
This number indicates the maximum number of files normal users (i.e. non-root) can have open in a single session. Note that for the root user, ulimit -n will sometimes output 1024 even after following the procedure to increase the maximum number of open files. This won't effect root's ability to open large numbers of files, as only normal users are bound by this value.
To increase the maximum number of open files beyond the default of 1024, two changes to the system may be necessary. In these examples, we will increase the maximum number of open files to the arbitrary value of 2048. All changes need to be made by the root user and users will need to log out and log back in before the changes will take effect.
   1. Configure the system to accept the desired value for maximum number of open files
      Check the value in /proc/sys/fs/file-max to see if it is larger than the value needed for the maximum number of open files:
      # cat /proc/sys/fs/file-max
      If the value isn't large enough, echo an appropriate number into the variable and add the change to /etc/sysctl.conf to make it persistent across reboots. If the number is already larger than the value you wish to use, skip to step 2.
      # echo 2048 > /proc/sys/fs/file-max
      and edit /etc/sysctl.conf to include the line:
      fs.file-max = 2048
   2. Set the value for maximum number of open files
      In the file /etc/security/limits.conf, below the commented line that reads
#                 
      add this line:
      * - nofile 2048
      This line sets the default number of open file descriptors for every user on the system to 2048. Note that the "nofile" item has two possible limit values under the  header: hard and soft. Both types of limits must be set before the change in the maximum number of open files will take effect. By using the "-" character, both hard and soft limits are set simultaneously.
      The hard limit represents the maximum value a soft limit may have and the soft limit represents the limit being actively enforced on the system at that time. Hard limits can be lowered by normal users, but not raised and soft limits cannot be set higher than hard limits. Only root may raise hard limits.
When increasing file limit descriptors, you may want to simply double the value. For example, if you need to increase the default value of 1024, increase the value to 2048 first. If you need to increase it again, try 4096, etc.
The information provided in this document is for your information only. The origin of this information may be internal or external to Red Hat. While Red Hat attempts to verify the validity of this information before it is posted, Red Hat makes no express or implied claims to its validity.
? 2003-2005 Red Hat, Inc. All rights reserved. This article is made available for copying and use under the Open Publication License, v1.0 which may be found at
http://www.opencontent.org/openpub/
.
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12737/showart_67290.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP