本文介绍了增加最大连接数Mac OS 10.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在运行Mac OS的双处理器G5上安装了Postgres 7.4.1 10.3.2。我正在尝试将max_connections增加到300并运行 陷入困境。如果有人能说出一些亮点,我会非常感激。很感激。 这是我postgresql.conf的一部分: # - 连接设置 - tcpip_socket = true max_connections = 300 # - 内存 - shared_buffers = 5000#min 16,至少max_connections * 2, 每个8KB #vacuum_mem = 8192 #min 1024,大小以KB为单位 但是当我尝试用pg_ctl开始postgres时我仍然会收到错误: 2004-02-09 11:07:24致命:无法创建共享内存段: 无效参数 详细信息:系统调用失败是shmget(键= 5432001,大小= 47030272, 03600)。 /> 提示:此错误通常意味着PostgreSQL要求共享 内存段超出了内核的SHMMAX参数。您可以使用减少请求大小或使用更大的SHMMAX重新配置内核。 要减小请求大小(目前为47030272字节),请减少 PostgreSQL的shared_buffers参数(目前为5000)和/或其 max_connections参数(目前为300)。 如果请求大小已经很小,那么它就是可能它比你的内核的SHMMIN参数少了b $ b,在这种情况下需要提高 请求大小或重新配置SHMMIN。 这里是我的etc / rc的相关部分: #系统调优 sysctl -w kern.maxvnodes = $(echo $( sysctl -n hw.physmem)''33554432/512 * 1024 $ sysctl -w kern.sysv.shmmax = 500772160 sysctl -w kern.sysv.shmmin = 1 sysctl -w kern.sysv.shmmni = 32 sysctl -w kern.sysv.shmseg = 8 sysctl -w kern.sysv.shmall = 65536 我之前尝试过shmmax设置那些在论坛上看到但是 那些也给了我一个错误。I installed Postgres 7.4.1 on a dual processor G5 running Mac OS10.3.2. I''m trying to increase the max_connections to 300 and runninginto some trouble. If anyone could shed some light, I''d greatlyappreciate it.Here''s part of my postgresql.conf:# - Connection Settings -tcpip_socket = truemax_connections = 300# - Memory -shared_buffers = 5000 # min 16, at least max_connections*2,8KB each#sort_mem = 1024 # min 64, size in KB#vacuum_mem = 8192 # min 1024, size in KBI''ve tried increasing the shmmax in /etc/rc to a really high number,but I''m still getting errors when I try to start postgres with pg_ctl:2004-02-09 11:07:24 FATAL: could not create shared memory segment:Invalid argumentDETAIL: Failed system call was shmget(key=5432001, size=47030272,03600).HINT: This error usually means that PostgreSQL''s request for a sharedmemory segment exceeded your kernel''s SHMMAX parameter. You can eitherreduce the request size or reconfigure the kernel with larger SHMMAX.To reduce the request size (currently 47030272 bytes), reducePostgreSQL''s shared_buffers parameter (currently 5000) and/or itsmax_connections parameter (currently 300).If the request size is already small, it''s possible that it isless than your kernel''s SHMMIN parameter, in which case raising therequest size or reconfiguring SHMMIN is called for.Here''s the relevant part of my etc/rc:# System tuningsysctl -w kern.maxvnodes=$(echo $(sysctl -n hw.physmem) ''33554432 / 512* 1024 $sysctl -w kern.sysv.shmmax=500772160sysctl -w kern.sysv.shmmin=1sysctl -w kern.sysv.shmmni=32sysctl -w kern.sysv.shmseg=8sysctl -w kern.sysv.shmall=65536I had previously tried the shmmax settings I''d seen on the forums butthose also gave me an error.推荐答案 这篇关于增加最大连接数Mac OS 10.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!