setting shmmax for postgres

Charles Swiger cswiger at mac.com
Mon Mar 20 21:33:41 UTC 2006


On Mar 20, 2006, at 4:29 PM, Miguel wrote:
>> Just how much RAM do you have in the machine?  I don't think you  
>> can  allocate more than 256MB or so to SysV shared memory without  
>> tuning  the number of KVA pages being allocated to the kernel...?   
>> Maybe it  depends on whether the SysV shmem segments are wired  
>> down by default  or not, I think there's a sysctl which controls  
>> that.
>
> I have 3G of RAM

OK.  You probably want to tune the SGA or whatever Postgres calls it  
to 512-768 MB, then, but I will happily defer to someone more  
familiar with that particular database.

>> You should revert Postgres back to a more reasonable default  
>> shared  region size for now and rebuild the kernel to increase  
>> these  parameters if you actually have the RAM and the need to do so.
>>
>> -- 
>> -Chuck
>
> what parameters?
> I cant find any related in GENERIC

Look at NOTES, specificly here:

# Set the number of PV entries per process.  Increasing this can
# stop panics related to heavy use of shared memory.  However, that can
# (combined with large amounts of physical memory) cause panics at
# boot time due the kernel running out of VM space.
#
# If you're tweaking this, you might also want to increase the sysctls
# "vm.v_free_min", "vm.v_free_reserved", and "vm.v_free_target".
#
# The value below is the one more than the default.
#
options         PMAP_SHPGPERPROC=201

#
# Change the size of the kernel virtual address space.  Due to
# constraints in loader(8) on i386, this must be a multiple of 4.
# 256 = 1 GB of kernel address space.  Increasing this also causes
# a reduction of the address space in user processes.  512 splits
# the 4GB cpu address space in half (2GB user, 2GB kernel).
#
options         KVA_PAGES=260

-- 
-Chuck



More information about the freebsd-questions mailing list