Use of IPCs command in Linux system

Time:2021-4-17

purpose
Report the status of interprocess communication facilities.

grammar

Copy code

The code is as follows:

ipcs [-mqs] [-abcopt] [-C core] [-N namelist]

-M outputs information about shared memory
-Q outputs information about the message queue
-S outputs semaphore information
# ipcs -m
IPC status from as of Tuesday, April 10, 2007 18:32:18 CST
T ID KEY MODE OWNER GROUP
Shared Memory:
m 0 0x50000d43 –rw-r–r– root root
m 501 0x1e90c97c –rw-r—– oracle dba

Ipcrm – delete IPC (clear shared memory information)
quote
Its syntax:

Copy code

The code is as follows:

ipcrm -m|-q|-s shm_id

-M outputs information about shared memory
-Q outputs information about the message queue
-S outputs semaphore information
shm_ ID shared memory ID
#ipcrm -m 501

describe
The IPCS command writes some information about the active interprocess communication facility to the standard output. If no flag is specified, the IPCS command writes in short format some titles about the currently active message queue, shared memory segment, semaphore, remote queue, and local queue.
The column headings and the meaning of the columns in the IPCS command are listed below. The letters in parentheses indicate the flag that causes the corresponding header to appear. The all designator indicates that the header is always displayed. These flags only determine what information is provided to each device. But they are not sure which devices will be listed.

IPCs view message queue command

Copy code

The code is as follows:

ISD_1_3_sles10_64:/usr/local/services/httpd/bin # ipcs -ql

—— Messages: Limits ——–
max queues system wide =16
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536
————————————
Modify message queue size:

Copy code

The code is as follows:

Root: user / etc/ sysctl.conf </p>
#kernel.msgmnb =3520
kernel.msgmni = 2878

After saving, you need to execute sysctl – P, and then rebuild all message queues

IPCs – Q: displays all message queues

IPCs – QT: displays the creation time of the message queue and the time of sending and receiving the last message

Copy code

The code is as follows:

[email protected][192.168.99.90:/hai]$ ipcs -qt

—— Message Queues Send/Recv/Change Times ——–
msqid    owner      send                 recv                 change            
65536    mas        Not set              Not set              May 15 15:56:39   
98305    mas        May 15 15:59:22      May 15 15:59:22      May 15 15:56:39   

IPCs – QP: displays the ID of the process that puts messages into the message queue and fetches messages from the message queue

Copy code

The code is as follows:

[email protected][192.168.99.90:/hai]$ ipcs -qp

—— Message Queues PIDs ——–
msqid      owner      lspid      lrpid   
65536    mas             0         0
98305    mas         21941     21941

IPCs – Q – I msgid: displays the message information in the message queue structure

Copy code

The code is as follows:

[email protected][192.168.99.90:/hai]$ ipcs -q -i 98305

Message Queue msqid=98305
uid=512 gid=500 cuid=512        cgid=500        mode=0600
cbytes=0        qbytes=4203520  qnum=0  lspid=21941     lrpid=21941
send_time=Thu May 15 16:00:19 2008
rcv_time=Thu May 15 16:00:19 2008
change_time=Thu May 15 15:56:39 2008

IPCs – QL: display the restriction information of message queue:

Copy code

The code is as follows:

[email protected][192.168.99.90:/hai]$ ipcs -ql

—— Messages: Limits ——–
Max queues system wide = 2878 / / maximum number of processes
Max size of message (bytes) = 8192 / / maximum message length in queue
default max size of queue (bytes) = 4203520

Recommended Today

Envoy announced alpha version of native support for windows

Author: sunjay Bhatia Since 2016, porting envoy to the windows platform has been an important part of the projectOne of the goalsToday, we are excited to announce the alpha version of envoy’s windows native support. The contributor community has been working hard to bring the rich features of envoy to windows, which is another step […]