免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: badseed
打印 上一主题 下一主题

在RedHat 9中 如何设定一个用户能够打开的最大文件数??? [复制链接]

论坛徽章:
0
11 [报告]
发表于 2004-01-05 14:37 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

{不知道哪里有sysctl的新的文档。
旧的好像不能用。比如
sysctl -w net.inet.tcp.log_in_vain=1
sysctl -w net.inet.udp.log_in_vain=1
这两个命令不知道用什么代替了}

姐姐.=号中间有空格的

论坛徽章:
0
12 [报告]
发表于 2004-01-05 14:43 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

事实证明,没有空格是对的

  1. [root@linux shessical]# sysctl -w net.inet.udp.log_in_vain =1
  2. error: 'net.inet.udp.log_in_vain' must be of the form name=value
  3. error: Malformed setting '=1'
  4. [root@linux shessical]# sysctl -w net.inet.udp.log_in_vain=1
  5. error: 'net.inet.udp.log_in_vain' is an unknown key
复制代码


查google,基本上都是bsd的,很少linux的。有也是编程的。

论坛徽章:
0
13 [报告]
发表于 2004-01-05 14:46 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

[root@linux shessical]# sysctl -w net.inet.udp.log_in_vain=1
error: 'net.inet.udp.log_in_vain' is an unknown key
[root@linux shessical]# sysctl -w net.inet.udp.log_in_vain = 1
error: 'net.inet.udp.log_in_vain' must be of the form name=value
error: Malformed setting '='
error: '1' must be of the form name=value
[root@linux shessical]# sysctl -w net.inet.udp.log_in_vain =1
error: 'net.inet.udp.log_in_vain' must be of the form name=value
error: Malformed setting '=1'
[root@linux shessical]# sysctl -w net.inet.udp.log_in_vain=1
error: 'net.inet.udp.log_in_vain' is an unknown key


在sysctl -a里面没有net.inet.ctp.loa_in_vain的项


  1. [root@linux shessical]# sysctl -a
  2. abi.fake_utsname = 0
  3. abi.trace = 0
  4. abi.defhandler_libcso = 68157441
  5. abi.defhandler_lcall7 = 68157441
  6. abi.defhandler_elf = 0
  7. abi.defhandler_coff = 117440515
  8. dev.raid.speed_limit_max = 10000
  9. dev.raid.speed_limit_min = 100
  10. dev.rtc.max-user-freq = 64
  11. debug.rpmarch =
  12. debug.kerneltype =
  13. net.unix.max_dgram_qlen = 10
  14. net.token-ring.rif_timeout = 60000
  15. net.ipv4.conf.eth0.arp_filter = 0
  16. net.ipv4.conf.eth0.tag = 0
  17. net.ipv4.conf.eth0.log_martians = 0
  18. net.ipv4.conf.eth0.bootp_relay = 0
  19. net.ipv4.conf.eth0.medium_id = 0
  20. net.ipv4.conf.eth0.proxy_arp = 0
  21. net.ipv4.conf.eth0.accept_source_route = 1
  22. net.ipv4.conf.eth0.send_redirects = 1
  23. net.ipv4.conf.eth0.rp_filter = 1
  24. net.ipv4.conf.eth0.shared_media = 1
  25. net.ipv4.conf.eth0.secure_redirects = 1
  26. net.ipv4.conf.eth0.accept_redirects = 1
  27. net.ipv4.conf.eth0.mc_forwarding = 0
  28. net.ipv4.conf.eth0.forwarding = 0
  29. net.ipv4.conf.lo.arp_filter = 0
  30. net.ipv4.conf.lo.tag = 0
  31. net.ipv4.conf.lo.log_martians = 0
  32. net.ipv4.conf.lo.bootp_relay = 0
  33. net.ipv4.conf.lo.medium_id = 0
  34. net.ipv4.conf.lo.proxy_arp = 0
  35. net.ipv4.conf.lo.accept_source_route = 1
  36. net.ipv4.conf.lo.send_redirects = 1
  37. net.ipv4.conf.lo.rp_filter = 1
  38. net.ipv4.conf.lo.shared_media = 1
  39. net.ipv4.conf.lo.secure_redirects = 1
  40. net.ipv4.conf.lo.accept_redirects = 1
  41. net.ipv4.conf.lo.mc_forwarding = 0
  42. net.ipv4.conf.lo.forwarding = 0
  43. net.ipv4.conf.default.arp_filter = 0
  44. net.ipv4.conf.default.tag = 0
  45. net.ipv4.conf.default.log_martians = 0
  46. net.ipv4.conf.default.bootp_relay = 0
  47. net.ipv4.conf.default.medium_id = 0
  48. net.ipv4.conf.default.proxy_arp = 0
  49. net.ipv4.conf.default.accept_source_route = 1
  50. net.ipv4.conf.default.send_redirects = 1
  51. net.ipv4.conf.default.rp_filter = 1
  52. net.ipv4.conf.default.shared_media = 1
  53. net.ipv4.conf.default.secure_redirects = 1
  54. net.ipv4.conf.default.accept_redirects = 1
  55. net.ipv4.conf.default.mc_forwarding = 0
  56. net.ipv4.conf.default.forwarding = 0
  57. net.ipv4.conf.all.arp_filter = 0
  58. net.ipv4.conf.all.tag = 0
  59. net.ipv4.conf.all.log_martians = 0
  60. net.ipv4.conf.all.bootp_relay = 0
  61. net.ipv4.conf.all.medium_id = 0
  62. net.ipv4.conf.all.proxy_arp = 0
  63. net.ipv4.conf.all.accept_source_route = 0
  64. net.ipv4.conf.all.send_redirects = 1
  65. net.ipv4.conf.all.rp_filter = 0
  66. net.ipv4.conf.all.shared_media = 1
  67. net.ipv4.conf.all.secure_redirects = 1
  68. net.ipv4.conf.all.accept_redirects = 1
  69. net.ipv4.conf.all.mc_forwarding = 0
  70. net.ipv4.conf.all.forwarding = 0
  71. net.ipv4.neigh.eth0.locktime = 100
  72. net.ipv4.neigh.eth0.proxy_delay = 80
  73. net.ipv4.neigh.eth0.anycast_delay = 100
  74. net.ipv4.neigh.eth0.proxy_qlen = 64
  75. net.ipv4.neigh.eth0.unres_qlen = 3
  76. net.ipv4.neigh.eth0.gc_stale_time = 60
  77. net.ipv4.neigh.eth0.delay_first_probe_time = 5
  78. net.ipv4.neigh.eth0.base_reachable_time = 30
  79. net.ipv4.neigh.eth0.retrans_time = 100
  80. net.ipv4.neigh.eth0.app_solicit = 0
  81. net.ipv4.neigh.eth0.ucast_solicit = 3
  82. net.ipv4.neigh.eth0.mcast_solicit = 3
  83. net.ipv4.neigh.lo.locktime = 100
  84. net.ipv4.neigh.lo.proxy_delay = 80
  85. net.ipv4.neigh.lo.anycast_delay = 100
  86. net.ipv4.neigh.lo.proxy_qlen = 64
  87. net.ipv4.neigh.lo.unres_qlen = 3
  88. net.ipv4.neigh.lo.gc_stale_time = 60
  89. net.ipv4.neigh.lo.delay_first_probe_time = 5
  90. net.ipv4.neigh.lo.base_reachable_time = 30
  91. net.ipv4.neigh.lo.retrans_time = 100
  92. net.ipv4.neigh.lo.app_solicit = 0
  93. net.ipv4.neigh.lo.ucast_solicit = 3
  94. net.ipv4.neigh.lo.mcast_solicit = 3
  95. net.ipv4.neigh.default.gc_thresh3 = 1024
  96. net.ipv4.neigh.default.gc_thresh2 = 512
  97. net.ipv4.neigh.default.gc_thresh1 = 128
  98. net.ipv4.neigh.default.gc_interval = 30
  99. net.ipv4.neigh.default.locktime = 100
  100. net.ipv4.neigh.default.proxy_delay = 80
  101. net.ipv4.neigh.default.anycast_delay = 100
  102. net.ipv4.neigh.default.proxy_qlen = 64
  103. net.ipv4.neigh.default.unres_qlen = 3
  104. net.ipv4.neigh.default.gc_stale_time = 60
  105. net.ipv4.neigh.default.delay_first_probe_time = 5
  106. net.ipv4.neigh.default.base_reachable_time = 30
  107. net.ipv4.neigh.default.retrans_time = 100
  108. net.ipv4.neigh.default.app_solicit = 0
  109. net.ipv4.neigh.default.ucast_solicit = 3
  110. net.ipv4.neigh.default.mcast_solicit = 3
  111. net.ipv4.ipfrag_secret_interval = 600
  112. net.ipv4.tcp_low_latency = 0
  113. net.ipv4.tcp_frto = 0
  114. net.ipv4.tcp_tw_reuse = 0
  115. net.ipv4.icmp_ratemask = 6168
  116. net.ipv4.icmp_ratelimit = 100
  117. net.ipv4.tcp_adv_win_scale = 2
  118. net.ipv4.tcp_app_win = 31
  119. net.ipv4.tcp_rmem = 4096        87380   174760
  120. net.ipv4.tcp_wmem = 4096        16384   131072
  121. net.ipv4.tcp_mem = 195584       196096  196608
  122. net.ipv4.tcp_dsack = 1
  123. net.ipv4.tcp_ecn = 0
  124. net.ipv4.tcp_reordering = 3
  125. net.ipv4.tcp_fack = 1
  126. net.ipv4.tcp_orphan_retries = 0
  127. net.ipv4.inet_peer_gc_maxtime = 120
  128. net.ipv4.inet_peer_gc_mintime = 10
  129. net.ipv4.inet_peer_maxttl = 600
  130. net.ipv4.inet_peer_minttl = 120
  131. net.ipv4.inet_peer_threshold = 65664
  132. net.ipv4.igmp_max_memberships = 20
  133. net.ipv4.route.secret_interval = 600
  134. net.ipv4.route.min_adv_mss = 256
  135. net.ipv4.route.min_pmtu = 552
  136. net.ipv4.route.mtu_expires = 600
  137. net.ipv4.route.gc_elasticity = 8
  138. net.ipv4.route.error_burst = 500
  139. net.ipv4.route.error_cost = 100
  140. net.ipv4.route.redirect_silence = 2048
  141. net.ipv4.route.redirect_number = 9
  142. net.ipv4.route.redirect_load = 2
  143. net.ipv4.route.gc_interval = 60
  144. net.ipv4.route.gc_timeout = 300
  145. net.ipv4.route.gc_min_interval = 5
  146. net.ipv4.route.max_size = 65536
  147. net.ipv4.route.gc_thresh = 4096
  148. net.ipv4.route.max_delay = 10
  149. net.ipv4.route.min_delay = 2
  150. net.ipv4.icmp_ignore_bogus_error_responses = 0
  151. net.ipv4.icmp_echo_ignore_broadcasts = 0
  152. net.ipv4.icmp_echo_ignore_all = 0
  153. net.ipv4.ip_local_port_range = 32768    61000
  154. net.ipv4.tcp_max_syn_backlog = 1024
  155. net.ipv4.tcp_rfc1337 = 0
  156. net.ipv4.tcp_stdurg = 0
  157. net.ipv4.tcp_abort_on_overflow = 0
  158. net.ipv4.tcp_tw_recycle = 0
  159. net.ipv4.tcp_syncookies = 0
  160. net.ipv4.tcp_fin_timeout = 60
  161. net.ipv4.tcp_retries2 = 15
  162. net.ipv4.tcp_retries1 = 3
  163. net.ipv4.tcp_keepalive_intvl = 75
  164. net.ipv4.tcp_keepalive_probes = 9
  165. net.ipv4.tcp_keepalive_time = 7200
  166. net.ipv4.ipfrag_time = 30
  167. net.ipv4.ip_dynaddr = 0
  168. net.ipv4.ipfrag_low_thresh = 196608
  169. net.ipv4.ipfrag_high_thresh = 262144
  170. net.ipv4.tcp_max_tw_buckets = 180000
  171. net.ipv4.tcp_max_orphans = 32768
  172. net.ipv4.tcp_synack_retries = 5
  173. net.ipv4.tcp_syn_retries = 5
  174. net.ipv4.ip_nonlocal_bind = 0
  175. net.ipv4.ip_no_pmtu_disc = 0
  176. net.ipv4.ip_autoconfig = 0
  177. net.ipv4.ip_default_ttl = 64
  178. net.ipv4.ip_forward = 0
  179. net.ipv4.tcp_retrans_collapse = 1
  180. net.ipv4.tcp_sack = 1
  181. net.ipv4.tcp_window_scaling = 1
  182. net.ipv4.tcp_timestamps = 1
  183. net.core.divert_version = 0.46
  184. net.core.hot_list_length = 128
  185. net.core.optmem_max = 10240
  186. net.core.message_burst = 50
  187. net.core.message_cost = 5
  188. net.core.mod_cong = 290
  189. net.core.lo_cong = 100
  190. net.core.no_cong = 20
  191. net.core.no_cong_thresh = 20
  192. net.core.netdev_max_backlog = 300
  193. net.core.dev_weight = 64
  194. net.core.rmem_default = 65535
  195. net.core.wmem_default = 65535
  196. net.core.rmem_max = 131071
  197. net.core.wmem_max = 131071
  198. vm.max_map_count = 65536
  199. vm.max-readahead = 31
  200. vm.min-readahead = 3
  201. vm.page-cluster = 3
  202. vm.pagetable_cache = 25 50
  203. vm.kswapd = 512 32      8
  204. vm.overcommit_memory = 0
  205. vm.bdflush = 50 500     0       0       500     3000    80      50      0
  206. kernel.overflowgid = 65534
  207. kernel.overflowuid = 65534
  208. kernel.random.uuid = 3a294e8a-2c1c-4bba-8ae5-e9e3d37ea170
  209. kernel.random.boot_id = dbca1f88-f52c-4701-beeb-5a7b8831c409
  210. kernel.random.write_wakeup_threshold = 128
  211. kernel.random.read_wakeup_threshold = 8
  212. kernel.random.entropy_avail = 4096
  213. kernel.random.poolsize = 512
  214. kernel.pid_max = 32768
  215. kernel.threads-max = 8192
  216. kernel.cad_pid = 1
  217. kernel.sysrq = 0
  218. kernel.sem = 250        32000   32      128
  219. kernel.msgmnb = 16384
  220. kernel.msgmni = 16
  221. kernel.msgmax = 8192
  222. kernel.shmmni = 4096
  223. kernel.shmall = 2097152
  224. kernel.shmmax = 33554432
  225. kernel.rtsig-max = 1024
  226. kernel.rtsig-nr = 4
  227. kernel.acct = 4 2       30
  228. kernel.hotplug = /sbin/hotplug
  229. kernel.modprobe = /sbin/modprobe
  230. kernel.printk = 6       4       1       7
  231. kernel.ctrl-alt-del = 0
  232. kernel.real-root-dev = 256
  233. kernel.cap-bound = -257
  234. kernel.tainted = 0
  235. kernel.core_pattern = core
  236. kernel.core_uses_pid = 1
  237. kernel.print_fatal_signals = 0
  238. kernel.panic = 0
  239. kernel.domainname = (none)
  240. kernel.hostname = linux.ocry.com
  241. kernel.version = #1 SMP Thu Dec 11 13:15:04 EST 2003
  242. kernel.osrelease = 2.4.20-27.9smp
  243. kernel.ostype = Linux
  244. fs.quota.syncs = 7
  245. fs.quota.free_dquots = 0
  246. fs.quota.allocated_dquots = 0
  247. fs.quota.cache_hits = 0
  248. fs.quota.writes = 0
  249. fs.quota.reads = 0
  250. fs.quota.drops = 0
  251. fs.quota.lookups = 0
  252. fs.lease-break-time = 45
  253. fs.dir-notify-enable = 1
  254. fs.leases-enable = 1
  255. fs.overflowgid = 65534
  256. fs.overflowuid = 65534
  257. fs.dentry-state = 7368  6114    45      0       0       0
  258. fs.file-max = 52428
  259. fs.file-nr = 474        78      52428
  260. fs.inode-state = 6419   48      0       0       0       0       0
  261. fs.inode-nr = 6419      48
  262. [root@linux shessical]#
复制代码

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
14 [报告]
发表于 2004-01-05 14:46 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

这两个是做什么用的?

论坛徽章:
0
15 [报告]
发表于 2004-01-05 14:48 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

姐姐说的对!

支持支持!

论坛徽章:
0
16 [报告]
发表于 2004-01-05 14:52 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

[quote]原帖由 "q1208c"]这两个是做什么用的?[/quote 发表:

纪录尝试向你的机器要求你机器未有的服务的connection记录
若你的机器没有跑named 而对方想要向您要求DNS的服务你会看到...

$tail -10 /var/log/message  

ohaha /kernel: Connection attempt to TCP 你的IP位置:53 from 对方IP位置:2731

其中2731 乃是只某一个高於1024的high port ...


其它的都不懂是什么意思。

要是有文档就好了。

论坛徽章:
0
17 [报告]
发表于 2004-01-05 17:12 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

原帖由 "wangfeixue" 发表:
sysctl -a |more
sysctl -w file-max = 20000000000000你想添多少添多少!

你这样只是修改了整个系统可以同时打开的文件数,并没有针对单个用户,也就是说只有root用户可以享受到这样的好处。
我的目的是想非root用户直接用 ulimit -n 200000 这样的命令修改自己可以同时打开的文件数。

论坛徽章:
0
18 [报告]
发表于 2004-01-06 09:16 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

up

论坛徽章:
0
19 [报告]
发表于 2004-01-07 12:42 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

论坛徽章:
0
20 [报告]
发表于 2004-01-12 11:00 |只看该作者

在RedHat 9中 如何设定一个用户能够打开的最大文件数???

找到答案了
在/etc/pam.d/login 里面添加一句
session required pam_limits.so

然后
修改 /proc/sys/fs/file-max 的值为所有用户能够打开的文件数,(e.g. 在/etc/sysctl.conf文件中加入一行 fs.file-max = 200000 ,然后在命令行中输入 :sysctl –p ,使其生效)。

编辑 /etc/security/limits.conf: 文件,插入一行:userx hard nofile 16000

用userx身份登录,在命令行中敲入 ulimit -n 16000

为了让设置永久生效,编辑用户的登陆环境文件 /home/userx/.bashrc ,插入一行:ulimit -n 16000
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP