在用的apache服務器,啟動報錯:
代碼如下:
shmget() failed: Invalid argument
Failed to start up concurrent users module!
經檢查為kernel.shmmax設置未生效(copy另一系統的,數值設置大了)
如下:
代碼如下:
[root@localhost ~]# sysctl -a | grep shmm
kernel.shmmni = 4096
kernel.shmmax = 0
[root@localhost ~]# vi /etc/sysctl.conf
kernel.shmmax = 2147483648
kernel.shmall = 1073742
[root@localhost ~]# sysctl -p
[root@localhost ~]# sysctl -a | grep shm
vm.hugetlb_shm_group = 0
kernel.shmmni = 4096
kernel.shmall = 1073742
kernel.shmmax = 2147483648
kernel.shmmax 數值說明:
單位:字節。一般建議使用物理內存的一半
以4G內存為例:4096/2*1024*1024=2147483648
kernel.shmall 數值說明:
單位:頁。1頁=4k,設置數值則為物理內存大小
以4G內存為例:4096*1024*1024/4000=1073742
注:以上兩項數值如果填寫大于本身物理內存則會不生效。
希望以上介紹的解決方法,可以解決大家遇到的問題。
新聞熱點
疑難解答