linux下file descriptoer限制
linux下file descriptoer限制
默认分类 2009-11-21 14:47 阅读0 评论0
字号: 大大 中中 小小
Tuning file descriptor limits on Linux
Linux limits the number of file descriptors that any one process may open; the default limits are 1024 per process. These limits can prevent optimum performance of both benchmarking clients (such as httperf and apachebench) and of the web servers themselves (Apache is not affected, since it uses a process per connection, but single process web servers such as Zeus use a file descriptor per connection, and so can easily fall foul of the default limit).
The open file limit is one of the limits that can be tuned with the ulimit command. The command
ulimit -aS
displays the current limit, and
ulimit -aH
displays the hard limit (above which the limit cannot be increased without tuning kernel parameters in /proc).
The following is an example of the output of
ulimit -aH
. You can see that the current shell (and its children) is restricted to 1024 open file descriptors.
core file size (blocks) unlimiteddata seg size (kbytes) unlimitedfile size (blocks) unlimitedmax locked memory (kbytes) unlimitedmax memory size (kbytes) unlimitedopen files 1024pipe size (512 bytes) 8stack size (kbytes) unlimitedcpu time (seconds) unlimitedmax user processes 4094virtual memory (kbytes) unlimited
Increasing the file descriptor limit
The file descriptor limit can be increased using the following procedure:
Edit
/etc/security/limits.conf
and add the lines:
* soft nofile 1024
* hard nofile 65535
Edit
/etc/pam.d/login
, adding the line:
session required /lib/security/pam_limits.so
The system file descriptor limit is set in
/proc/sys/fs/file-max
. The following command will increase the limit to 65535:
echo 65535 > /proc/sys/fs/file-max
You should then be able to increase the file descriptor limits using:
ulimit -n unlimitedThe above
相关文档:
一.库的分类
有两种说法,如果熟悉WIN平台下的DLL,相信不难理解:
库可以有三种使用的形式:静态、共享和动态。静态库的代码在编译时就已连接到开发人员开发的应用程序中,而共享库只是在程序开始运行时才载入,在编译时,
只是简单地指定需要使用的库函数。动态库则是 ......
将php服务器架到linux下时没有注意该问题,
前几天倒是碰到了在linux下验证码的图片无法显示的情况,发现linux下也要有gd库的支持,于是安装了php5-gd(本人使用的是php5)
,这个问题解决了
今天突然发现img图片无法显示,上网搜了一把,又经过测试得出如下结论
<img src="pc.jpg"......>
他会以当前路径 ......
用tar包配置高可用性vsftp
vsftpd安装包:ftp://vsftpd.beasts.org/users/cevans/
开启: service iptables start
关闭: service iptables stop
/etc/init.d/iptables start/stop
或者在任何目录下都可以用你上面得命令。两者是相等的。
第二个问题是因为你的主机名改掉了。
修改下面两个文件
1./etc/hosts
......
可以通过下面命令查看当前编码方式:
h@debian-server:~/$ locale -a
C
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
POSIX
zh_CN
zh_CN.gb1 ......
作者:bioforge alkerr@yifan.net
原名: <<Hacking the Linux Kernel Network Stack>>
翻译,修改: duanjigang <duanjigang1983@126.com>
翻译参考:raodan (raod_at_30san.com) 2003-08-22
第一章 简介
本文将描述如何利用Linux网络堆栈的窍门(不一定都是漏洞)来达到一些目的,或 ......