OSDN Git Service

Allow extract() to accept the same field selectors as date_part(), not just
[pg-rex/syncrep.git] / doc / FAQ_BSDI
1 This outlines modifications to BSD/OS for running PostgreSQL:
2
3 1)  How to increase resource limits
4 2)  How to increase the number of shared memory buffers
5 3)  How to increasing the number of semaphores
6
7 Bruce Momjian (pgman@candle.pha.pa.us)  2000-07-7
8
9 ---------------------------------------------------------------------------
10
11 1)  To increase the amount of malloc'ed memory and files opened by
12 PostgreSQL, add this:
13
14           :datasize-cur=256M:\
15           :openfiles-cur=256:
16
17 to your /etc/login.conf file.
18
19 ---------------------------------------------------------------------------
20
21 2a)  By default, only 4MB of shared memory is supported by BSDI. Keep in
22 mind that shared memory is not pageable.  It is locked in RAM.
23
24 The shared memory parameters are:
25
26 #define SHMMAX          /* max shared memory segment size (bytes) */
27 #define SHMMIN          /* min shared memory segment size (bytes) */
28 #define SHMMNI          /* max number of shared memory identifiers */
29 #define SHMSEG          /* max shared memory segments per process */
30 #define SHMALL          /* max amount of shared memory (pages) */
31
32 To increase the number of buffers supported by the postmaseter, add the
33 following to your kernel config file.  A SHMALL value of 1024 
34 represents 4MB of shared memory.  Increase it accordingly:
35
36 options "SHMALL=4096"
37 options "SHMMAX=\(SHMALL*PAGE_SIZE\)"
38
39 For those running 4.1 or later, just recompile the kernel and reboot. 
40 For those running earlier releases, see step 2b.
41
42 ---------------------------------------------------------------------------
43
44 2b)  For 4.01 and earlier, use bpatch to find the sysptsize value for
45 the current kernel.  This is computed dynamically at bootup.
46
47         $ bpatch -r sysptsize
48         0x9 = 9
49
50 Next, change SYSPTSIZE to a hard-coded value.  Use the bpatch value,
51 plus add 1 for every additional 4MB of shared memory you desire.
52
53 options "SYSPTSIZE=13"
54
55 sysptsize can not be changed by sysctl on the fly.
56
57 ---------------------------------------------------------------------------
58
59 3)  How to increasing the number of semaphores.
60
61 You may need to increase the number of sysv semaphores. By default,
62 PostgreSQL allocates 32 semaphores, one for each backend connection. 
63 This is just over half the default system total of 60.
64
65 The defaults are in /sys/sys/sem.h:
66
67 #define SEMMNI  10              /* # of semaphore identifiers */
68
69 #define SEMMNS  60              /* # of semaphores in system */
70
71 #define SEMUME  10              /* max # of undo entries per process */
72
73 #define SEMMNU  30              /* # of undo structures in system */
74
75 Set the values you want in your kernel config file, e.g.:
76
77 options "SEMMNI=40"
78 options "SEMMNS=240"
79 options "SEMUME=40"
80 options "SEMMNU=120"
81