Обсуждение: shared memory 651, freebsd 2.2.7
How much shared memory do you need? options SHMMNI=96 # number of shared memory identifiers default is 32 options SHMMAXPGS=20480 # number of pages a shgment can have and the total number of pages? default 1024 # max seg size is 25meg options SHMSEG=64 # number of segments per process options SEMMNI=40 # number of semaphore identifiers options SEMMNS=240 # number of semaphores in the system options MSGSEG=4096 # max number of message segments is this With Postgres set for 512 backends, I can't start it. I can run with 128, but at 10240 have been running out during large transactions. I am hoping I can get it at 20480.
Jason Venner <jason@idiom.com> writes: > How much shared memory do you need? What's probably getting you is the SEMMNS & SEMMNI limits --- we need a semaphore per backend, and an identifier for every 16 semas. I thought there was a discussion of kernel resource settings somewhere in the documentation, but I'm not sure where offhand. regards, tom lane
> > > How much shared memory do you need? > > options SHMMNI=96 # number of shared memory identifiers default is 32 > options SHMMAXPGS=20480 # number of pages a shgment can have and the total number of pages? default 1024 > # max seg size is 25meg > options SHMSEG=64 # number of segments per process > options SEMMNI=40 # number of semaphore identifiers > options SEMMNS=240 # number of semaphores in the system > options MSGSEG=4096 # max number of message segments is this > > With Postgres set for 512 backends, I can't start it. > I can run with 128, but at 10240 have been running out during large transactions. > I am hoping I can get it at 20480. What do you need 512 backends for? Such a high concurrency doesn't make things better (locking, spin locks etc.). Would eventually some kind of a middle tear application with a limited number of work processes which connect to the database help? Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #========================================= wieck@debis.com (Jan Wieck) #
At 03:16 AM 9/30/99 +0200, Jan Wieck wrote: > Would eventually some kind of a middle tear application with > a limited number of work processes which connect to the > database help? This is exactly how some web servers, i.e. AOLServer (which I use) help to throttle traffic. This server lets you limit the number of pooled backends, when the pool's exhausted, the web server blocks new threads until there's a free back end. This means you can configure your web server to service the number of concurrent back-ends you think it can deal with, based on its hardware configuration and the load placed on it due to your specific queries and database contents, and web load. AOLServer's been doing this for at least five years. For web work, it's seems to be the right place to do it, because there are other things that impact the load the server can deal with. The db access throttle is just one of various throttles one can imagine when trying to tune the entire site. Of course, this is web specific in detail. Not necessarily in concept, though... - Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert Serviceand other goodies at http://donb.photo.net.