| 4 | 1/1 | 返回列表 |
| 查看: 1017 | 回復(fù): 3 | ||
sunmuer木蟲(chóng) (小有名氣)
|
[求助]
如何限制用戶使用的cpu數(shù)
|
|
有一臺(tái)HP的服務(wù)器,用戶有4個(gè)左右。 如何去限制用戶使用的cpu數(shù)呢? 或者能夠限制用戶使用的硬盤(pán)空間也行。 在google上找到一個(gè)用quota之類(lèi)的命令操作的,看的有點(diǎn)暈。 有高手詳細(xì)指點(diǎn)將感激不盡。 |

木蟲(chóng) (小有名氣)
|
我看了下鳥(niǎo)哥的私房菜-linux基礎(chǔ)篇,找到了如何限制硬盤(pán)使用。資料在下面的鏈接中: http://www.gaoyang168.com/bbs/viewthread.php?tid=4102177&fpage=1 但是如何限制用戶使用CPU數(shù)還是沒(méi)有發(fā)現(xiàn)適用的方法。 |

木蟲(chóng) (小有名氣)
|
事實(shí)上,俺早就看上這個(gè)帖子了。 但是俺為什么幾個(gè)月都沒(méi)回帖呢?! 其實(shí)俺也不知道。 今天做量子力學(xué)作業(yè)做得心情不好,偶然間看到陳年老帖子,決定來(lái)散散心。 實(shí)際上,要限制用戶使用的CPU一定是通過(guò)系統(tǒng)設(shè)置實(shí)現(xiàn)的。 那就很明顯了,系統(tǒng),LZ您用的是什么系統(tǒng)呢?不同的系統(tǒng)有不同情況,你不和俺說(shuō),俺怎么幫你解決問(wèn)題呢! 那俺就猜你用的是opensuse12.2(為什么是這個(gè)系統(tǒng)呢?因?yàn)榘秤玫木褪撬?br /> /etc/security/limits.conf 當(dāng)你找到這份文件的時(shí)候,一切問(wèn)題都成浮云了。 俺們了看看里面都寫(xiě)了些啥: ======================================================(此線不在文件內(nèi),俺不知道為啥畫(huà)了這) # /etc/security/limits.conf # #Each line describes a limit for a user in the form: # # # #Where: # # - an user name # - a group name, with @group syntax # - the wildcard *, for default entry # - the wildcard %, can be also used with %group syntax, # for maxlogin limit # # # - "soft" for enforcing the soft limits # - "hard" for enforcing hard limits # # # - core - limits the core file size (KB) # - data - max data size (KB) # - fsize - maximum filesize (KB) # - memlock - max locked-in-memory address space (KB) # - nofile - max number of open files # - rss - max resident set size (KB) # - stack - max stack size (KB) # - cpu - max CPU time (MIN) # - nproc - max number of processes # - as - address space limit (KB) # - maxlogins - max number of logins for this user # - maxsyslogins - max number of logins on the system # - priority - the priority to run user process with # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) # - nice - max nice priority allowed to raise to values: [-20, 19] # - rtprio - max realtime priority # # # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 # End of file ======================================================== 不多不少,10個(gè)金幣,謝謝! 俺不貪心,你說(shuō)是吧! |

木蟲(chóng) (小有名氣)

| 4 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 334分 一志愿武理 材料求調(diào)劑 +7 | 李李不服輸 2026-03-26 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 275求調(diào)劑 +13 | Micky11223 2026-03-25 | 18/900 |
|
|
[考研] 070305高分子化學(xué)與物理 304分求調(diào)劑 +12 | c297914 2026-03-28 | 12/600 |
|
|
[考研] 一志愿:西北大學(xué),英一數(shù)一408-284分求調(diào)劑 +4 | 12.27 2026-03-27 | 4/200 |
|
|
[考研] 329求調(diào)劑 +10 | 鈕恩雪 2026-03-25 | 10/500 |
|
|
[考研] 340求調(diào)劑 +6 | Amber00 2026-03-26 | 6/300 |
|
|
[考研] 086000生物與醫(yī)藥調(diào)劑 +5 | Feisty。 2026-03-28 | 9/450 |
|
|
[考研] 279求調(diào)劑 +4 | 蝶舞輕繞 2026-03-29 | 4/200 |
|
|
[考研] 調(diào)劑求院校招收 +6 | 鶴鯨鴿 2026-03-28 | 6/300 |
|
|
[考研] 343求調(diào)劑 +5 | 愛(ài)羈絆 2026-03-28 | 5/250 |
|
|
[考研] 286求調(diào)劑 +12 | PolarBear11 2026-03-26 | 12/600 |
|
|
[考研] 0703化學(xué)/290求調(diào)劑/本科經(jīng)歷豐富/工科也可 +9 | 丹青奶蓋 2026-03-26 | 10/500 |
|
|
[考研] 285求調(diào)劑 +4 | AZMK 2026-03-27 | 7/350 |
|
|
[考研] 考研化學(xué)308分求調(diào)劑 +10 | 你好明天你好 2026-03-23 | 12/600 |
|
|
[考研] 333求調(diào)劑 +3 | question挽風(fēng) 2026-03-23 | 3/150 |
|
|
[碩博家園] 北京林業(yè)大學(xué)碩導(dǎo)招生廣告 +6 | kongweilin 2026-03-26 | 8/400 |
|
|
[考研]
|
WWW西西弗斯 2026-03-24 | 8/400 |
|
|
[考研] 材料專碩 335 分求調(diào)劑 +4 | 拒絕冷暴力 2026-03-25 | 4/200 |
|
|
[考研] 282求調(diào)劑 +3 | wcq131415 2026-03-24 | 3/150 |
|
|
[考研] 一志愿山東大學(xué)藥學(xué)學(xué)碩求調(diào)劑 +3 | 開(kāi)開(kāi)心心沒(méi)煩惱 2026-03-23 | 4/200 |
|