【正文】
If an invalid mask is given (., one that corresponds to no valid CPUs on thecurrent system) an error is returned. the highest order bit corresponding to the last logical CPU. CPU keepprocesses on the system. DESCRIPTIONtaskset [rootdevelop1 ~] taskset pc 01 6457pid 6457’s current affinity list: 03pid 6457’s new affinity list: 0,1修改之后我們看到,已經(jīng)修改為0,1的范圍了。 不過CPU0負(fù)載還是最大的。 V, version ma, list of processors instead of a bitmask. c, cpulist2. 如果父進(jìn)程設(shè)置了affinity,之后其創(chuàng)建的子進(jìn)程是否會有同樣的屬性?我發(fā)現(xiàn)子進(jìn)程確實(shí)繼承了父進(jìn)程的affinity屬性。這里0010 0100 1000是掩碼,分別代表第4顆cpu核心。這是用來配置nginx啟動幾個工作進(jìn)程的,默認(rèn)為1。 aptget install schedutils對運(yùn)行中的進(jìn)程,文檔上說可以用下面的命令,把CPU1 2 3分配給PID為2345的進(jìn)程: taskset cp 1,2,3 2345但我嘗試沒奏效,于是我關(guān)掉了MySQL,并用taskset將它啟動: taskset c 1,2,3 /etc/對于其他進(jìn)程,也可如此處理(nginx除外,詳見下文)。[更多...]一、在Linux上修改進(jìn)程的“CPU親和力”在Linux上,可以通過因此,若能將CPU0分擔(dān)的任務(wù)攤派到其他CPU核心上,可以預(yù)見,系統(tǒng)的處理能力將有更大的提升。************************************************************************************************************************