ipcs 命令

ipcs 命令ipcs 分析消息队列 共享内存和信号量 ipcs reportstatus Withnooption

ipcs – 分析消息队列、共享内存和信号量
ipcs – report status of interprocess communication facilities

ipcs displays certain information about active interprocess communication facilities. With no options, ipcs displays information in short format for the message queues, shared memory segments, and semaphores that are currently active in the system.



引用

它的语法:

ipcs [-mqs] [-abcopt] [-C core] [-N namelist]
-m 输出有关共享内存(shared memory)的信息
-q 输出有关信息队列(message queue)的信息
-s 输出信号量(semaphore)的信息
# ipcs -m
IPC status from as of 2007年04月10日 星期二 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 – 删除ipc(清除共享内存信息)


引用
它的语法:
ipcrm -m|-q|-s shm_id
-m 输出有关共享内存(shared memory)的信息
-q 输出有关信息队列(message queue)的信息
-s 输出信号量(semaphore)的信息
shm_id 共享内存id
#ipcrm -m 501





其打印出当前你的系统中处于活动状态的共享内存的信息。

对每一个资源,这个命令会显示:

TYPE        包括信息队列(q),共享内存段(m),或者信号灯(s)。

ID         资源条目的唯一的表示号

KEY        应用程序存取资源使用的参数。

MODE        存取模式和许可权限的标记

OWNER and GROUP   登录名和用户属主的组号,OnLine使用的所有的共享内存资源的属主的属主          为root和informix组。

OnLine共享内存使用的基本键值为0x。SERVERNUM的值乘上0X10000并且加上这个值就为共享内存的键值。这就 是,如果你的SERVERNUM的值为2,你的共享内存段的键值为0x+(2*0x10000)=0x。如果 SERVERNUM的值为6,产生的键值就为0x525c4801。

清除命令:
ipcs -s | grep nobody | perl -e ‘while (

) { @a=split(/”s+/); print `ipcrm sem $a[1]`}’




然后启动 Apache 即可

更深入的了解:

 

Fixing Apache “No space left on device: Couldn’t create accept lock” errors

Error Message: When starting Apache, I get this error message in the main Apache error_log:

[emerg] (28)No space left on device: Couldn’t create accept lock
[notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[notice] Digest: generating secret for digest authentication …
[notice] Digest: done
[warn] pid file /etc/httpd/run/httpd.pid overwritten — Unclean shutdown of previous Apache run?
[emerg] (28)No space left on device: Couldn’t create accept lock




First off, check to make sure that you really aren’t out of disk space, or have hit a quota limit. Another way that Apache can create the “accept lock” is with a semaphore. A semaphore is an inter-process communication tool that is used by Apache to communicate with it’s child processes. This error message may mean that Apache couldn’t create a new semaphore.

Check to see how many semaphores are currently in use. If Apache is running correctly, you should see something like this:

# ipcs -s
—— Semaphore Arrays ——–
key semid owner perms nsems
0x00000000 apache 600 1
0x00000000 apache 600 1
0x00000000 apache 600 1




If Apache is stopped, and you still see these semaphores, then you can safely kill them by running this command for each semaphore id (in the second column)

$ ipcrm -s

To destroy all semaphores, you can run this from the command line (with “apache” being the apache-user):

for semid in `ipcs -s | grep nobody | cut -f2 -d” “`;

do ipcrm -s $semid; done


If you are out of semaphores

If you can’t create any more semaphores:

Sometimes your system may need to increase the number of semaphores that are available on the system. This requires a change to a kernel parameter. If you are running on a virtual server and cannot modify kernel parameters, you may need to ask your hosting provider to change this parameter on their host server To view the current parameters:

# ipcs -l
—— Shared Memory Limits ——–
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) =
min seg size (bytes) = 1

—— Semaphore Limits ——–
max number of arrays = 1024
max semaphores per array = 250
max semaphores system wide =
max ops per semop call = 32
semaphore max value = 32767

—— Messages: Limits ——–
max queues system wide = 1024
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384















To change these parameters, modify the file /etc/sysctl.conf and add the following lines:

kernel.msgmni = 1024
kernel.sem = 250 32 1024

Then load these settings with the command:

sysctl -p

Your Apache process should now be able to create the needed semaphores and run properly

这里介绍下kernel.msgmni

/proc/sys/kernel/msgmni

该文件指定消息队列标识的最大数目,即系统范围内最大多少个消息队列。
缺省设置:16

root 下用 sysctl kernel.msgmni 检查该参数, 也可以在命令行下

sysctl -w kernel.msgmni=XXX 重新设定。

 

man ipcs:

ipcs(1)                                                              ipcs(1)

            (none)          This is equivalent to -mqs.

            -s              Display information about active semaphores.

Hewlett-Packard Company             – 1 –    HP-UX Release 11i: November 2000

ipcs(1)                                                              ipcs(1)

       The following options redefine the sources of information.

            T          Facility type:

            ID         The identifier for the facility entry.

                      The first two characters can be:

                      others.

            OWNER      The login name of the owner of the facility entry.

            CREATOR    The login name of the creator of the facility entry.

            SEGSZ      The size of the associated shared memory segment.

Hewlett-Packard Company             – 3 –    HP-UX Release 11i: November 2000

ipcs(1)                                                              ipcs(1)

Hewlett-Packard Company             – 4 –    HP-UX Release 11i: November 2000



转载于:https://www.cnblogs.com/rootq/articles/1339475.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/208869.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月19日 上午10:35
下一篇 2026年3月19日 上午10:35


相关推荐

  • 气动手套结构

    气动手套结构

    2026年3月15日
    3
  • alsa sample rate跟踪 <1>

    alsa sample rate跟踪 <1>alsasamplerate跟踪本计划全部放在一篇中,后来发现太长。因此截取成四篇,一口气看800多行,确实够烦的!之前以为alsalib中的rateplugin之所以被调用,是因为在asound.conf中指定了硬件的samplerate,例如rate48000。但实际测试下来,发现不是这么回事。无论asound.conf中是否有rate48000,驱动中得到

    2022年10月16日
    3
  • IDEA中web项目maven项目打war包的方式

    IDEA中web项目maven项目打war包的方式手动打包 amp maven 工具打包方式详解 1 打开 idea 如图 2 如图 1 2 3 步 3 就出现一个新的 接下来配置一下 4 点加号 选 D C 5 选择你项目得到 webapp 点 OK6 创建文件夹 WEB INF7 在 WEB INF 里建 classes8 选中 classes 点加号 选 M O 9 选你的项目 点 OK 这时候的结构是这样的 11 在 WEB INF 下创建 lib 放 jar 包

    2026年3月17日
    2
  • 如何识别一加6手机图片中的文字?

    如何识别一加6手机图片中的文字?新出的一加6手机性能很好,如何识别一加6手机图片中的文字?文字识别就是识别大量文字用到,能提高办公人员的效率,当然你手机还有更多功能。1在手机上输入迅捷PDF阅读器,然后开始识别相册图片的文字2打开就是这样的界面,找到倒数第2个的小功能3选择拍照识别中的相…

    2022年5月1日
    209
  • 粗糙集理论_简述粗糙集不确定性

    粗糙集理论_简述粗糙集不确定性粗糙集理论1粗糙集的基本概念在粗糙集理论中,我们把知识看做是一种能被用于分类对象的能力。其中对象可以代表现实世界中的任意事物,包括物品、属性、概念等。即:知识需要同现实世界中特定环境的确定对象相

    2022年8月4日
    15
  • Pytest(8)parametrize参数化「建议收藏」

    Pytest(8)parametrize参数化「建议收藏」前言当某个接口中的一个字段,里面规定的范围为1-5,你5个数字都要单独写一条测试用例,就太麻烦了,这个时候可以使用pytest.mark.parametrize装饰器可以实现测试用例参数化。官方示

    2022年7月28日
    10

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号