| 5 | 1/1 | 返回列表 |
| 查看: 1020 | 回復(fù): 3 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
sunmuer木蟲 (小有名氣)
|
[求助]
如何限制用戶使用的cpu數(shù)
|
||
|
有一臺HP的服務(wù)器,用戶有4個左右。 如何去限制用戶使用的cpu數(shù)呢? 或者能夠限制用戶使用的硬盤空間也行。 在google上找到一個用quota之類的命令操作的,看的有點(diǎn)暈。 有高手詳細(xì)指點(diǎn)將感激不盡。 |

木蟲 (小有名氣)
|
事實(shí)上,俺早就看上這個帖子了。 但是俺為什么幾個月都沒回帖呢?! 其實(shí)俺也不知道。 今天做量子力學(xué)作業(yè)做得心情不好,偶然間看到陳年老帖子,決定來散散心。 實(shí)際上,要限制用戶使用的CPU一定是通過系統(tǒng)設(shè)置實(shí)現(xiàn)的。 那就很明顯了,系統(tǒng),LZ您用的是什么系統(tǒng)呢?不同的系統(tǒng)有不同情況,你不和俺說,俺怎么幫你解決問題呢! 那俺就猜你用的是opensuse12.2(為什么是這個系統(tǒng)呢?因?yàn)榘秤玫木褪撬?br /> /etc/security/limits.conf 當(dāng)你找到這份文件的時候,一切問題都成浮云了。 俺們了看看里面都寫了些啥: ======================================================(此線不在文件內(nèi),俺不知道為啥畫了這) # /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個金幣,謝謝! 俺不貪心,你說是吧! |

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

木蟲 (小有名氣)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 085600,專業(yè)課化工原理,320分求調(diào)劑 +4 | 大饞小子 2026-03-29 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 290求調(diào)劑 +3 | dfffsar 2026-03-29 | 3/150 |
|
|
[考研] 各位老師好,我的一志愿為北京科技大學(xué)085601材料專碩 +9 | Koxui 2026-03-28 | 9/450 |
|
|
[考研] 294分080500材料科學(xué)與工程求調(diào)劑 +8 | 柳溪邊 2026-03-26 | 8/400 |
|
|
[考研] 291求調(diào)劑 +7 | Y-cap 2026-03-29 | 8/400 |
|
|
[考研] 一志愿:西北大學(xué),英一數(shù)一408-284分求調(diào)劑 +4 | 12.27 2026-03-27 | 4/200 |
|
|
[考研] 071000生物學(xué)求調(diào)劑,初試成績343 +7 | 小小甜面團(tuán) 2026-03-25 | 7/350 |
|
|
[考研] 一志愿南昌大學(xué)324求調(diào)劑 +7 | hanamiko 2026-03-27 | 7/350 |
|
|
[考研] 張芳銘-中國農(nóng)業(yè)大學(xué)-環(huán)境工程專碩-298 +4 | 手機(jī)用戶 2026-03-26 | 4/200 |
|
|
[考研] 315分求調(diào)劑 +7 | 26考研上岸版26 2026-03-26 | 7/350 |
|
|
[考研] 070300化學(xué)求調(diào)劑 +4 | 起個名咋這么難 2026-03-27 | 4/200 |
|
|
[考研] 272求調(diào)劑 +7 | 腳滑的守法公民 2026-03-27 | 7/350 |
|
|
[考博] 26申博 +3 | 加油沖! 2026-03-26 | 3/150 |
|
|
[考研] 287求調(diào)劑 +10 | land xuxu 2026-03-26 | 10/500 |
|
|
[考研] 316求調(diào)劑 +5 | Pigcasso 2026-03-24 | 5/250 |
|
|
[考研] 333求調(diào)劑 +6 | wfh030413@ 2026-03-23 | 6/300 |
|
|
[考研] 材料專碩 335 分求調(diào)劑 +4 | 拒絕冷暴力 2026-03-25 | 4/200 |
|
|
[有機(jī)交流]
20+3
|
FENGSHUJEI 2026-03-23 | 5/250 |
|
|
[考研] 材料專碩找調(diào)劑 +5 | 哈哈哈吼吼吼哈 2026-03-23 | 5/250 |
|
|
[考研] 化工專碩求調(diào)劑 +3 | question挽風(fēng) 2026-03-24 | 3/150 |
|