zoukankan      html  css  js  c++  java
  • postgresql出错could not create semaphores: No space left on device

    在postgres中,当max_connect设置过大,启动的时候会报错:

    FATAL:  could not create semaphores: No space left on device

    创建semaphores时空间参数不够,查询官网,有这么一段解释:

    HINT:  This error does *not* mean that you have 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 number 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 about configuring your system for PostgreSQL.
    解决的方法是改小max_connect,当业务不允许的情况下,修改内核参数,max_connect相关的内核参数有:

     

     下面介绍如何修改内核参数

    # ipcs -ls
     
    ------ Semaphore Limits --------
    max number of arrays = 1280
    max semaphores per array = 50100
    max semaphores system wide = 64128000
    max ops per semop call = 50100
    semaphore max value = 32767
     
     
    # cat  /proc/sys/kernel/sem
    SEMMSL   SEMMNS         SEMOPM  SEMMNI
    50100   128256000       50100   2560
    SEMMSL 每个信号量set中信号量最大个数
    SEMMNS linux系统中信号量最大个数
    SEMOPM semop系统调用允许的信号量最大个数设置,设置成和SEMMSL一样即可
    SEMMNI  linux系统信号量set最大个数
     
    所以SEMMNS=SEMMSL*SEMMNI
    修改 vi /etc/sysctl.conf 的以下参数
    kernel.sem = 50100 128256000 50100 2560
    sysctl -p生效
    重启数据库即可
  • 相关阅读:
    最易懂的语音自动增益原理介绍
    共振峰估计基础
    语音基音周期估计基础
    语音信号临界带宽的概念解释
    语音信号的时域维纳滤波器原理简介
    几种改进的谱减算法简介
    谱减算法的缺点和过减因子、谱下限的关系
    关于语音分帧时有重叠部分的原因分析
    x264命令参数与代码中变量的对应关系
    笔记--语音信号的预加重
  • 原文地址:https://www.cnblogs.com/mingfan/p/12915713.html
Copyright © 2011-2022 走看看