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

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

木蟲(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ō)是吧! |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 0703 化學(xué) 求調(diào)劑,一志愿山東大學(xué) 342 分 +5 | Shern—- 2026-03-28 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 085601材料工程找調(diào)劑 +14 | oatmealR 2026-03-29 | 15/750 |
|
|
[考研] 281求調(diào)劑 +4 | 亞克西good 2026-03-26 | 6/300 |
|
|
[考研] 調(diào)劑310 +12 | 溫柔的晚安 2026-03-25 | 13/650 |
|
|
[考研] 343求調(diào)劑085601 +3 | 要努力學(xué)習(xí)x 2026-03-29 | 3/150 |
|
|
[考研] 327求調(diào)劑 +6 | 汲亦昊 2026-03-29 | 6/300 |
|
|
[考研] 316求調(diào)劑 +7 | 江辭666 2026-03-26 | 7/350 |
|
|
[考研] 一志愿華北電力大學(xué)能動(dòng)專碩,293,求調(diào)劑 +3 | 15537177284 2026-03-23 | 5/250 |
|
|
[考研] 070300求調(diào)劑306分 +4 | 26要上岸 2026-03-27 | 4/200 |
|
|
[考研] 調(diào)劑 +3 | 好好讀書(shū)。 2026-03-28 | 3/150 |
|
|
[考研] 材料求調(diào)劑一志愿哈工大324 +7 | 閆旭東 2026-03-28 | 9/450 |
|
|
[考研] 086000調(diào)劑 +3 | 7901117076 2026-03-26 | 3/150 |
|
|
[考研] 安徽大學(xué)專碩生物與醫(yī)藥專業(yè)(086000)324分,英語(yǔ)已過(guò)四六級(jí),六級(jí)521,求調(diào)劑 +4 | 美味可樂(lè)雞翅 2026-03-26 | 4/200 |
|
|
[論文投稿] Journal of Mechanical Science and Technology +3 | Russ_ss 2026-03-25 | 5/250 |
|
|
[碩博家園] 北京林業(yè)大學(xué)碩導(dǎo)招生廣告 +6 | kongweilin 2026-03-26 | 8/400 |
|
|
[考研] 求調(diào)劑,一志愿 南京航空航天大學(xué)大學(xué) ,080500材料科學(xué)與工程學(xué)碩 +4 | @taotao 2026-03-26 | 5/250 |
|
|
[考研] 343求調(diào)劑 +4 | 贈(zèng)我一本書(shū) 2026-03-23 | 4/200 |
|
|
[考研] 總分322求生物學(xué)/生化與分子/生物信息學(xué)相關(guān)調(diào)劑 +5 | 星沉uu 2026-03-26 | 6/300 |
|
|
[考研] 一志愿哈工大,085400,320,求調(diào)劑 +4 | gdlf9999 2026-03-24 | 4/200 |
|
|
[論文投稿] 急發(fā)核心期刊論文 +3 | 賢達(dá)問(wèn)津 2026-03-23 | 5/250 |
|