Apache startup reports shmget () failed: Invalid argument Solution

Source: Internet
Author: User

When the apache server is used, the following error occurs:

Copy codeThe Code is as follows: shmget () failed: Invalid argument
Failed to start up concurrent users module!

Check that the setting for kernel. shmmax is invalid (copy another system, the value setting is too large)

As follows:

Copy codeThe Code is as follows: [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

Description of kernel. shmmax values:
Unit: bytes. We recommend that you use half of the physical memory.
Taking 4G memory as an example: 4096/2*1024*1024 = 2147483648

Description of kernel. shmall values:
Unit: page. 1 page = 4 k, set the value to the physical memory size
Taking 4G memory as an example: 4096*1024*1024/4000 = 1073742

Note: The preceding two values do not take effect if they are greater than the physical memory.

We hope the solution described above can solve your problems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.