Thread: PostgreSQL BSDI BSD/OS port

PostgreSQL BSDI BSD/OS port

From
"David J. MacKenzie"
Date:
Your name        :    David MacKenzie
Your email address    :    djm@web.us.uu.net


System Configuration
---------------------
  Architecture (example: Intel Pentium)      : Intel x86

  Operating System (example: Linux 2.0.26 ELF)     : BSD/OS 4.0.1

  PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.2

  Compiler used (example:  gcc 2.8.0)        : gcc version 2.7.2.1


Please enter a FULL description of your problem:
------------------------------------------------

Here are some corrections for the BSD/OS port.  BSD/OS doesn't define
LC_MESSAGES, so that needs to be ifdef'd, and the kernel tuning
parameters are incomplete and suboptimal.

Index: src/backend/utils/adt/pg_locale.c
===================================================================
RCS file: /export/src/CVS/usr.local/bin/postgresql-7.0/src/backend/utils/adt/pg_locale.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** src/backend/utils/adt/pg_locale.c    2000/06/30 21:15:43    1.1
--- src/backend/utils/adt/pg_locale.c    2000/06/30 22:51:00    1.2
***************
*** 40,46 ****
--- 40,48 ----
      lc->lc_time = setlocale(LC_TIME, NULL);
      lc->lc_collate = setlocale(LC_COLLATE, NULL);
      lc->lc_monetary = setlocale(LC_MONETARY, NULL);
+ #ifdef LC_MESSAGES
      lc->lc_messages = setlocale(LC_MESSAGES, NULL);
+ #endif /* LC_MESSAGES */

      return lc;
  }
***************
*** 62,68 ****
--- 64,74 ----
           lc->lc_time,
           lc->lc_collate,
           lc->lc_monetary,
+ #ifdef LC_MESSAGES
           lc->lc_messages
+ #else /* LC_MESSAGES */
+          "unimplemented"
+ #endif /* LC_MESSAGES */
      );

      return lc;
***************
*** 92,99 ****
--- 98,107 ----
      if (!setlocale(LC_MONETARY, lc->lc_monetary))
          elog(NOTICE, "pg_setlocale(): 'LC_MONETARY=%s' cannot be honored.", lc->lc_monetary);

+ #ifdef LC_MESSAGES
      if (!setlocale(LC_MESSAGES, lc->lc_messages))
          elog(NOTICE, "pg_setlocale(): 'LC_MESSAGE=%s' cannot be honored.", lc->lc_messages);
+ #endif /* LC_MESSAGES */

      return lc;
  }
Index: doc/FAQ_BSDI
===================================================================
RCS file: /export/src/CVS/usr.local/bin/postgresql-7.0/doc/FAQ_BSDI,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** doc/FAQ_BSDI    2000/06/30 21:15:35    1.1
--- doc/FAQ_BSDI    2000/07/07 14:23:18    1.2
***************
*** 8,19 ****
--- 8,56 ----

  ---------------------------------------------------------------------------

+ You may need to increase the number of sysv semaphores.
+ PostgreSQL 7 allowing the default number of backend connections
+ allocates 32 semaphores, which is just over half the default system
+ total of 60.
+
+ The defaults are in /sys/sys/sem.h:
+
+ /* Configuration parameters */
+ #ifndef SEMMNI
+ #define SEMMNI  10              /* # of semaphore identifiers */
+ #endif
+ #ifndef SEMMNS
+ #define SEMMNS  60              /* # of semaphores in system */
+ #endif
+ #ifndef SEMUME
+ #define SEMUME  10              /* max # of undo entries per process */
+ #endif
+ #ifndef SEMMNU
+ #define SEMMNU  30              /* # of undo structures in system */
+ #endif
+
+ Set the values you want in your kernel config file, e.g.:
+
+ options "SEMMNI=40"
+ options "SEMMNS=240"
+ options "SEMUME=40"
+ options "SEMMNU=120"
+
+ ---------------------------------------------------------------------------
+
  Increase SHMMAXPGS by 1024 for every additional 4MB of shared
  memory:

  /sys/sys/shm.h:69:#define       SHMMAXPGS       1024    /* max hardware pages...

  The default setting of 1024 is for a maximum of 4MB of shared memory.
+ PostgresSQL 7 allowing the default number of backend connections
+ allocates about 1.2MB of shared memory.
+
+ Enclose the above line with "#ifndef SHMMAXPGS" and "#endif", and in
+ your kernel config file set the desired value, e.g.:
+
+ options "SHMMAXPGS=8192"

  For those running 4.1 or later, just recompile the kernel and reboot.
  For those running earlier releases, there are more steps outlined below.
***************
*** 24,34 ****
  This is computed dynamically at bootup.

      $ bpatch -r sysptsize
!     0x9 = 9

! Next, change SYSPTSIZE to a hard-coded value.  Use the bpatch value,
! plus add 1 for every additional 4MB of shared memory you desire.

  /sys/i386/i386/i386_param.c:28:#define  SYSPTSIZE 0        /* dynamically...

  sysptsize can not be changed by sysctl on the fly.
--- 61,77 ----
  This is computed dynamically at bootup.

      $ bpatch -r sysptsize
!     0x16 = 22

! Set SYSPTSIZE in your kernel config file, e.g.:

+ options "SYSPTSIZE=29"
+
+ Use the bpatch value, plus add 1 for every additional 4MB of shared
+ memory you desire.  For reference, the default is set here:
+
  /sys/i386/i386/i386_param.c:28:#define  SYSPTSIZE 0        /* dynamically...

  sysptsize can not be changed by sysctl on the fly.
+
+ ---------------------------------------------------------------------------

Re: PostgreSQL BSDI BSD/OS port

From
Bruce Momjian
Date:
This has been applied the the current development tree.  Thanks.


> Your name        :    David MacKenzie
> Your email address    :    djm@web.us.uu.net
>
>
> System Configuration
> ---------------------
>   Architecture (example: Intel Pentium)      : Intel x86
>
>   Operating System (example: Linux 2.0.26 ELF)     : BSD/OS 4.0.1
>
>   PostgreSQL version (example: PostgreSQL-7.0):   PostgreSQL-7.0.2
>
>   Compiler used (example:  gcc 2.8.0)        : gcc version 2.7.2.1
>
>
> Please enter a FULL description of your problem:
> ------------------------------------------------
>
> Here are some corrections for the BSD/OS port.  BSD/OS doesn't define
> LC_MESSAGES, so that needs to be ifdef'd, and the kernel tuning
> parameters are incomplete and suboptimal.
>
> Index: src/backend/utils/adt/pg_locale.c
> ===================================================================
> RCS file: /export/src/CVS/usr.local/bin/postgresql-7.0/src/backend/utils/adt/pg_locale.c,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -c -r1.1 -r1.2
> *** src/backend/utils/adt/pg_locale.c    2000/06/30 21:15:43    1.1
> --- src/backend/utils/adt/pg_locale.c    2000/06/30 22:51:00    1.2
> ***************
> *** 40,46 ****
> --- 40,48 ----
>       lc->lc_time = setlocale(LC_TIME, NULL);
>       lc->lc_collate = setlocale(LC_COLLATE, NULL);
>       lc->lc_monetary = setlocale(LC_MONETARY, NULL);
> + #ifdef LC_MESSAGES
>       lc->lc_messages = setlocale(LC_MESSAGES, NULL);
> + #endif /* LC_MESSAGES */
>
>       return lc;
>   }
> ***************
> *** 62,68 ****
> --- 64,74 ----
>            lc->lc_time,
>            lc->lc_collate,
>            lc->lc_monetary,
> + #ifdef LC_MESSAGES
>            lc->lc_messages
> + #else /* LC_MESSAGES */
> +          "unimplemented"
> + #endif /* LC_MESSAGES */
>       );
>
>       return lc;
> ***************
> *** 92,99 ****
> --- 98,107 ----
>       if (!setlocale(LC_MONETARY, lc->lc_monetary))
>           elog(NOTICE, "pg_setlocale(): 'LC_MONETARY=%s' cannot be honored.", lc->lc_monetary);
>
> + #ifdef LC_MESSAGES
>       if (!setlocale(LC_MESSAGES, lc->lc_messages))
>           elog(NOTICE, "pg_setlocale(): 'LC_MESSAGE=%s' cannot be honored.", lc->lc_messages);
> + #endif /* LC_MESSAGES */
>
>       return lc;
>   }
> Index: doc/FAQ_BSDI
> ===================================================================
> RCS file: /export/src/CVS/usr.local/bin/postgresql-7.0/doc/FAQ_BSDI,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -c -r1.1 -r1.2
> *** doc/FAQ_BSDI    2000/06/30 21:15:35    1.1
> --- doc/FAQ_BSDI    2000/07/07 14:23:18    1.2
> ***************
> *** 8,19 ****
> --- 8,56 ----
>
>   ---------------------------------------------------------------------------
>
> + You may need to increase the number of sysv semaphores.
> + PostgreSQL 7 allowing the default number of backend connections
> + allocates 32 semaphores, which is just over half the default system
> + total of 60.
> +
> + The defaults are in /sys/sys/sem.h:
> +
> + /* Configuration parameters */
> + #ifndef SEMMNI
> + #define SEMMNI  10              /* # of semaphore identifiers */
> + #endif
> + #ifndef SEMMNS
> + #define SEMMNS  60              /* # of semaphores in system */
> + #endif
> + #ifndef SEMUME
> + #define SEMUME  10              /* max # of undo entries per process */
> + #endif
> + #ifndef SEMMNU
> + #define SEMMNU  30              /* # of undo structures in system */
> + #endif
> +
> + Set the values you want in your kernel config file, e.g.:
> +
> + options "SEMMNI=40"
> + options "SEMMNS=240"
> + options "SEMUME=40"
> + options "SEMMNU=120"
> +
> + ---------------------------------------------------------------------------
> +
>   Increase SHMMAXPGS by 1024 for every additional 4MB of shared
>   memory:
>
>   /sys/sys/shm.h:69:#define       SHMMAXPGS       1024    /* max hardware pages...
>
>   The default setting of 1024 is for a maximum of 4MB of shared memory.
> + PostgresSQL 7 allowing the default number of backend connections
> + allocates about 1.2MB of shared memory.
> +
> + Enclose the above line with "#ifndef SHMMAXPGS" and "#endif", and in
> + your kernel config file set the desired value, e.g.:
> +
> + options "SHMMAXPGS=8192"
>
>   For those running 4.1 or later, just recompile the kernel and reboot.
>   For those running earlier releases, there are more steps outlined below.
> ***************
> *** 24,34 ****
>   This is computed dynamically at bootup.
>
>       $ bpatch -r sysptsize
> !     0x9 = 9
>
> ! Next, change SYSPTSIZE to a hard-coded value.  Use the bpatch value,
> ! plus add 1 for every additional 4MB of shared memory you desire.
>
>   /sys/i386/i386/i386_param.c:28:#define  SYSPTSIZE 0        /* dynamically...
>
>   sysptsize can not be changed by sysctl on the fly.
> --- 61,77 ----
>   This is computed dynamically at bootup.
>
>       $ bpatch -r sysptsize
> !     0x16 = 22
>
> ! Set SYSPTSIZE in your kernel config file, e.g.:
>
> + options "SYSPTSIZE=29"
> +
> + Use the bpatch value, plus add 1 for every additional 4MB of shared
> + memory you desire.  For reference, the default is set here:
> +
>   /sys/i386/i386/i386_param.c:28:#define  SYSPTSIZE 0        /* dynamically...
>
>   sysptsize can not be changed by sysctl on the fly.
> +
> + ---------------------------------------------------------------------------
>


--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026