linux最大文件数限制
作者:anotherbug 日期:2007-03-16 09:31:09
http://www.xenoclast.org/doc/benchmark/HTTP-benchmarking-HOWTO/node7.html
Performance tuning
General Tuning Tips
The essentials of tuning Apache for optimum performance are discussed in depth at
http://httpd.apache.org/docs/misc/perf-tuning.html. Some of the advice given here is definitely Apache specific, but parts (or at least the principles behind them) are more generally applicable.
Some simple rules follow:
Only enable those modules you absolutely require. Each additional module implies additional processing overhead, even though you may not be making active use of the module on your site.
Where possible, use static content instead of dynamic content. If you are generating weather reports that are updated once an hour, then it is better to write a program that generates a static file once an hour than to have users run a CGI to generate the report on the fly.
When choosing an API for your dynamic applications, choose the fastest and most appropriate one available. CGI may be easy to program for, but it forks a process for each request - usually an expensive and unnecessary procedure. FastCGI is a better alternative, as is Apache's mod_perl- both provide persistency and can increase performance significantly.
If your server performance is a critical issue for you (or you just want to get the maximum number of bangs for your bucks), then choose a high performance web server instead of Apache. Apache's process model sucks, frankly; it uses an individual process for each connection, leading to massive context switching when you have a large number of simultaneous connections. Single process per CPU servers such as Zeus and Boa are significantly faster; Zeus has held the SPECweb96 and 99 records for the majority of the last five years. Unfortunately, however, it is commercial, but is worth the money if you want to eke the last drop of performance out of your server.
Zeus: http://www.zeus.com/
Boa: http://www.boa.org/
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 unlimited
The above command will set the limits to the hard limit specified in /etc/security/limits.conf.
Note that you may need to log out and back in again before the changes take effect.
Performance tuning
General Tuning Tips
The essentials of tuning Apache for optimum performance are discussed in depth at
http://httpd.apache.org/docs/misc/perf-tuning.html. Some of the advice given here is definitely Apache specific, but parts (or at least the principles behind them) are more generally applicable.
Some simple rules follow:
Only enable those modules you absolutely require. Each additional module implies additional processing overhead, even though you may not be making active use of the module on your site.
Where possible, use static content instead of dynamic content. If you are generating weather reports that are updated once an hour, then it is better to write a program that generates a static file once an hour than to have users run a CGI to generate the report on the fly.
When choosing an API for your dynamic applications, choose the fastest and most appropriate one available. CGI may be easy to program for, but it forks a process for each request - usually an expensive and unnecessary procedure. FastCGI is a better alternative, as is Apache's mod_perl- both provide persistency and can increase performance significantly.
If your server performance is a critical issue for you (or you just want to get the maximum number of bangs for your bucks), then choose a high performance web server instead of Apache. Apache's process model sucks, frankly; it uses an individual process for each connection, leading to massive context switching when you have a large number of simultaneous connections. Single process per CPU servers such as Zeus and Boa are significantly faster; Zeus has held the SPECweb96 and 99 records for the majority of the last five years. Unfortunately, however, it is commercial, but is worth the money if you want to eke the last drop of performance out of your server.
Zeus: http://www.zeus.com/
Boa: http://www.boa.org/
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 unlimited
The above command will set the limits to the hard limit specified in /etc/security/limits.conf.
Note that you may need to log out and back in again before the changes take effect.
平均得分
(0 次评分)
评论: 43 | 查看次数: 4630
发表评论
订阅
上一篇
|

文章来自:
标签: 
wow gold
wow gold
wow gold
wow gold
wow gold
item4sale
item4sale
item4sale
item4sale
item4sale
buy age of conan gold
buy age of conan gold
buy age of conan gold
buy age of conan gold
buy age of conan gold
连锁洗衣店加盟
连锁洗衣店加盟
加盟干洗店连锁
加盟干洗店连锁
干洗机价格
干洗机价格
洗涤机械
洗涤机械
洗鞋
洗鞋
擦鞋连锁
擦鞋连锁
擦鞋店加盟
擦鞋店加盟
鞋机
鞋机
擦鞋修鞋
擦鞋修鞋
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
iuewuqsa69
自吸泵
自吸泵
自吸泵
自吸泵
液下泵
液下泵
液下泵
油泵
油泵
油泵
管道泵
管道泵
驾校
北京搬家公司
Google排名
货架
加拿大留学
留学加拿大
英国留学
留学美国
留学英国
美国留学
食道癌
直肠癌
结肠癌
清肺散结丸
肝癌
肺癌
胃癌
乳腺癌
乳腺癌
珍香胶囊
货架
搬家公司
北京搬家公司
北京搬家
搬家
aluminum easel
aluminium easel
货架
货架
写字楼出租
写字楼
翻译公司
北京翻译公司
猎头
婚庆
管道疏通
北京管道疏通
北京疏通管道
北京疏通下水道
北京高压清洗
北京崇文区管道疏通
清洗管道
清理化粪池
Led显示屏
礼品
礼品公司
iuewuqsa69
自吸泵
自吸泵
自吸泵
自吸泵
液下泵
液下泵
液下泵
油泵
油泵
油泵
管道泵
管道泵
Maple Story Mesos
wow gold
wow gold
wow gold
age of conan gold
age of conan
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
age of conan power leveling
age conan gold
age of conan gold
aoc gold
age conan gold
age of conan power leveling
aoc power leveling
age conan gold
Runescape Money
Runescape Gold
Runescape Items
Runescape Money
Runescape Gold
Runescape Power leveling
Runescape Money
Runescape Gold
Runescape gold
runescape money
Runescape Money
Runescape
Runescape Money
Runescape Power leveling
Runescape Items
runescape money
money runescape
Runescape Gold
age of conan gold
age conan gold
aoc gold
age of conan power leveling
aoc power leveling
aoc leveling
archlord gold
anarchy online credits
cabal alz
city of heroes influence
coh influence
city of heroes
city of villains infamy
cov infamy
city of villains
dofus kamas
kamas dofus
dofus
daoc gold
daoc plat
eve isk
eve online isk
eve online
everquest 2 gold
eq2 plat
Ever Quest 2
final fantasy xi gil
Final Fantasy XI
buy ffxi gil
gaia online gold
gaia gold
guild wars gold
gw gold
guild wars
hellgate london palladium
Hellgate London
dofus kamas
dofus gold
dofus
dofus kamas
dofus
wow gold
world of warcraft gold
buy wow gold
cheap wow gold
wow power leveling
eq plat
EverQuest gold
Maple Story Mesos
MapleStory mesos
MapleStory Meso
Final Fantasy XI gil
ffxi gil
buy ffxi gil
dofus kamas
kamas dofus
lotro gold
lotr gold
lord of the ring gold
Lineage adena
Lineage 1 adena
Silkroad gold
buy silkroad gold
flyff penya
buy flyff gold
flyff money
eve online isk
eve isk
2moons dil
2moons gold
eq2 plat
EverQuest 2 gold
maplestory Mesos
MapleStory meso
maple story
Maple Story Mesos
maplestory Mesos
MapleStory meso
Maple Story
Lineage adena
Lineage 1 adena
Lineage 1
lotro gold
lotr gold
The Lord Of The Ring
lord of the ring gold
ge money
granado espada vis
granado espada gold
Granado Espada
///////////////////////////////////////////////
wow gold
wow leveling
hero online gold
last chaos gold
ragnarok zeny
ro zeny
rappelz rupee
rappelz gold
Silkroad gold
buy silkroad gold
SWG Credits
star wars galaxies credits
tales of pirates gold
age of conan
age of conan gold
aoc gold
aoc power leveling
aion gold
buy aion gold
anarchy online credits
anarchy online credit
archlord gold
buy archlord gold
City of Heroes Infamy
coh influence
City of Villains infamy
cov infamy
Gaia Online Gold
gaia gold
Gods and Heroes
gods and heroes gold
ge money
granado espada vis
granado espada gold
hellgate london palladium
Hero online gold
buy hero gold
Last Chaos Gold
buy Last Chaos Gold
gw gold
Guild Wars Gold
Lineage 2 adena
buy lineage 2 adena
Tales of Pirates Gold
Tales Of Pirates Online
rappelz rupee
rappelz gold
Hellgate London
hellgate london palladium
Second Life Linden
second life money
Vanguard money
Buy Vanguard Gold
Tabula Rasa Credit
tabula rasa credits
货架
货架
北京搬家公司
加拿大留学
留学加拿大
驾校
北京驾校
肺癌
肝癌
食道癌
胃癌
乳腺癌
直肠癌
结肠癌
乳腺癌
珍香胶囊
清肺散结丸
婚庆
搬家公司
北京搬家公司
北京搬家
搬家
英国留学
留学美国
留学英国
美国留学
翻译公司
北京翻译公司
写字楼出租
写字楼
Google排名
猎头
管道疏通
北京管道疏通
北京疏通管道
北京疏通下水道
北京高压清洗
北京崇文区管道疏通
清洗管道
清理化粪池
Led显示屏
礼品
礼品公司
gtg08y
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
泵
泵
泵
泵
水泵
水泵
水泵
水泵
水泵
齿轮输油泵
齿轮输油泵
环保设备
环保设备
China Travel
China Tours
China Tours
beijing Tours
beijing Tours
beijing Travel
beijing Travel
shanghai Tours
shanghai Tours
shanghai Travel
shanghai Travel
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
World of Warcraft Gold
cheap wow gold
buy wow gold
buy cheap wow gold
wow gold price
wow gold guide
wow gold farming
gold wow gold
wow gold buy wow gold
wow gold com
wow gold forum
wow gold reviews
wow gold paypal
world of warcraft gold
wow gold credit card
wow gold sale
wow gold cheap
buying wow gold
buy gold for wow
gold wow
sell wow gold
wow gold eu
wow gold us
cheapest wow gold
www wow gold
sell wow gold us
lgx112358sss
wow gold
wow gold
wow gold
item4sale
item4sale
item4sale
item4sale
item4sale
item4sale
age of conan gold
age of conan gold
age of conan gold
age of conan gold
age of conan gold
wow gold
wow gold
wow gold
wow gold
wow gold
干洗连锁店
干洗连锁店
工业水洗机
工业水洗机
连锁加盟洗衣店
连锁加盟洗衣店
石油干洗设备
石油干洗设备
干洗设备价格
干洗设备价格
洗涤设备
洗涤设备
CAD软件
CAD软件
CAD软件下载
CAD软件下载
水洗房
水洗房
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
World of Warcraft Gold
cheap wow gold
buy wow gold
gold wow
ell wow gold
wow gold eu
wow gold us
cheapest wow gold
buy cheap wow gold
wow gold price
wow gold guide
wow gold farming
wow gold reviews
wow gold paypal
world of warcraft gold
wow gold credit card
wow gold sale
wow gold cheap
buying wow gold
buy gold for wow
gold wow gold
wow gold buy wow gold
wow gold com
wow gold forum
www wow gold
sell wow gold us
wow gold
wow gold
wow gold
wow gold
wow gold
新西兰签证
出国留学
德国签证
美国签证
wow gold
wow gold
buy wow account
wow account
wow accounts
buy wow accounts
buy wow account
wow account
wow accounts
buy wow accounts
爱尔兰签证
英国签证
新加坡签证
韩国签证
马来西亚签证
新加坡签证
wow gold
wow gold
wow gold
wow account
wow account
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
wow gold
高低温试验箱
振动试验台
恒温恒湿试验箱
恒温恒湿箱
恒温箱
振动台
盐雾箱
老化台
盐雾试验箱
高低温箱
低温试验箱
振动试验机
合同纠纷
房产纠纷
劳动纠纷
房地产律师
制氮机
在职研究生
液体壁纸
清水模板
冷弯型钢
牛仔服
牛仔服装厂
牛仔休闲
牛仔裤
牛仔品牌
牛仔专卖店
节能胶带机
胶带机价格
虹吸
虹吸雨水
虹吸排水
有压流
同层排水
恒温器
马达保护器
热保护器
温度开关
温控器
过流保护器
真空泵
藏獒
全自动表面张力仪/界面张力仪
舞台设计
烧烤网
振动筛网
拖链
光纤熔接机
光缆监测系统
时光域反射仪
不锈钢反应釜
风机
捏合机
制氮机
上海翻译
太阳能路灯
英语培训
英语口语
藏獒
防腐管道
液压缸
油缸
移民
投资移民
加拿大移民
技术移民
移民加拿大
澳洲技术移民
德国移民
移民澳洲
澳洲移民
出国移民
移民出国
英国移民
澳大利亚移民
加拿大投资移民
加拿大技术移民
北京旅游
北京旅行社
条码机
条码打印机
条形码打印机
防腐设备
煤气发生炉
美国留学
法国留学
法国留学
北欧留学
瑞典留学
芬兰留学
澳洲留学
除湿机
抽湿机
工业除湿机
空气净化器
空气净化机
美术培训
美术高考
美术高考培训
画室
北京画室
谐波治理
无功补偿
代孕
代孕妈妈
货架
货架
搬家公司
管道疏通
肺癌
肝癌
婚庆
写字楼出租
写字楼
货架
Cheap Warhammer gold
Warhammer Online gold
WAR Gold
Buy Warhammer Gold
Warhammer Online Gold
Warhammer Gold for sale
Warhammer Accounts
Buy Warhammer Accounts
Cheap Warhammer Accounts
Warhammer Power leveling
WAR Power leveling
Warhammer Online Power Leveling
Warhammer CD Key
WAR CD Key
Warhammer Online CD Key
Warhammer Game Time Card