Pgsql error after optimization could not create semaphores:no space

Source: Internet
Author: User

Server 32G Memory Space


Parameter optimization

$ VI postgresql.conf

Shared_buffers = 3072MB

Max_connections = 4000

Work_mem = 4MB

Effective_cache_size = 4GB

Maintenance_work_mem = 512MB

Wal_buffers = 256


Specific optimization parameter Interpretation reference: 70233820


Error starting Service

$ pg_ctl-d/data/pg_data Start

Server starting

$ log:could Not create IPV6 socket:address family not supported by protocol

Fatal:could not create Semaphores:no space left on device

detail:failed system call is Semget (5432124, 17, 03600).

Hint:this error does *not* mean that you had run out of disk space. It occurs when either the system limit for the maximum number of semaphore sets (Semmni), or the system wide maximum Numbe  R of Semaphores (Semmns), would be exceeded.  You need to raise the respective kernel parameter. Alternatively, reduce PostgreSQL ' s consumption of semaphores by reducing its max_connections parameter.

The PostgreSQL documentation contains more information on configuring your system for PostgreSQL.

Log:database system is shut down


Analysis:

This is because the configuration of the shared memory in the kernel parameter limits the maximum number of connections, the specific reference blog: https://www.cnblogs.com/xiaotengyi/p/5439231.html


Workaround:

# vi/etc/sysctl.conf

Kernel.sem = 50100 128256000 50100 2560


Overloaded configuration

# sysctl-p

Vm.min_free_kbytes = 409600

Vm.vfs_cache_pressure = 200

vm.swappiness = 0

Fs.file-max = 6815744

FS.AIO-MAX-NR = 1048576

KERNEL.SYSRQ = 1

Kernel.sem = 50100 128256000 50100 2560

Net.core.rmem_default = 2621440

Net.core.wmem_default = 2621440

Net.core.rmem_max = 2621440

Net.core.wmem_max = 2621440

Net.ipv4.tcp_rmem = 4096 655360 2621440

Net.ipv4.tcp_wmem = 4096 655360 2621440

Pgsql error after optimization could not create semaphores:no space

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.