Linux作業系統ipcs命令

來源:互聯網
上載者:User

Linux作業系統ipcs命令 ipcs: 主要提供調用進程讀取存取一些ipc裝置資訊.如:共用記憶體,訊號量,訊息佇列 ipcs [ -asmq ] [ -tclup ] ipcs [ -smq ] -i id -m 輸出共用記憶體(shared memory segments)的資訊 -s 輸出訊號量(semaphore)的資訊 -q 輸出訊息佇列(message queues)的資訊 -l limits 01root@10.1.1.45:log# ipcs02 03------ Shared Memory Segments --------04key        shmid      owner      perms      bytes      nattch     status     05 06------ Semaphore Arrays --------07key        semid      owner      perms      nsems    080x00002af9 131072     db        664        1        090x00002afb 163841     db        664        1        100x00002b03 65538      db        664        1        110x00002b05 98307      db        664        1        12 13------ Message Queues --------14key        msqid      owner      perms      used-bytes   messages其中Key為應用程式存取資源使用的參數,id為資源條目的唯一標示號.例如實際情況可能會遇到db使用者程式是用root賬戶啟動,這時首先root賬戶關掉db使用者的程式,但共用記憶體有可能未釋放,需要手動刪除.這就要用到ipcrm 命令. ipcrm - remove a message queue, semaphore set or shared memory id ipcrm [ -M key | -m id | -Q key | -q id | -S key | -s id ]  -m shmid -q msqid -s semid 01root@10.1.1.45:log# ipcs -s02 03------ Semaphore Arrays --------04key        semid      owner      perms      nsems    050x00002af9 131072     db        664        1        060x00002afb 163841     db        664        1        070x00002b03 65538      db        664        1        080x00002b05 98307      db        664        109 10root@10.1.1.45:log# ipcrm -s 13107211root@10.1.1.45:log# ipcrm -s 16384112root@10.1.1.45:log# ipcrm -s 6553813root@10.1.1.45:log# ipcrm -s 9830714 15root@10.1.1.45:~# ipcs16 17------ Shared Memory Segments --------18key        shmid      owner      perms      bytes      nattch     status     19 20------ Semaphore Arrays --------21key        semid      owner      perms      nsems    22 23------ Message Queues --------24key        msqid      owner      perms      used-bytes   messages   01root@10.1.1.45:~# ipcs -l02 03------ Shared Memory Limits --------04max number of segments = 409605max seg size (kbytes) = 3276806max total shared memory (kbytes) = 838860807min seg size (bytes) = 108 09------ Semaphore Limits --------10max number of arrays = 12811max semaphores per array = 25012max semaphores system wide = 3200013max ops per semop call = 3214semaphore max value = 3276715 16------ Messages: Limits --------17max queues system wide = 1618max size of message (bytes) = 819219default max size of queue (bytes) = 16384有2種方法改變其值1.更改/etc/sysctl.conf ,添加kernel.msgmni = 1024,生效載入配置使用sysctl -p kernel.msgmni 該檔案指定訊息佇列標識的最大數目,即系統範圍內最大多少個訊息佇列。 1root@10.1.1.45:~# cat /proc/sys/kernel/msgmni2163root@10.1.1.45:~# vim /etc/sysctl.conf4root@10.1.1.45:~# sysctl -p5kernel.msgmni = 10246root@10.1.1.45:~# cat /proc/sys/kernel/msgmni710242.在root下使用sysctl命令,直接生效. 1root@10.1.1.45:~# sysctl -w kernel.msgmni=162kernel.msgmni = 163root@10.1.1.45:~# cat /proc/sys/kernel/msgmni416 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.