Skip site navigation (1) Skip section navigation (2)

Re: PostgreSQL BSDI BSD/OS port

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "David J(dot) MacKenzie" <djm(at)web(dot)us(dot)uu(dot)net>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: PostgreSQL BSDI BSD/OS port
Date: 2000-07-07 19:20:40
Message-ID: 200007071920.PAA03075@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-ports
I have already fixed the LC_MESSAGES issue for 7.1.

I have made a new BSDI item #3 for your semaphore changes.  I did not
make the shared memory changes you suggested because it requires changes
to the kernel include files and the config files.  I prefer suggestting
the change only in one place.  If it were not for the requirement of
#ifndef, I would prefer the config file change.

New BSDI FAQ version attached:

> 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 -u -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,7 +40,9 @@
>  	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,7 +64,11 @@
>  		 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,8 +98,10 @@
>  	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
> ===================================================================
> diff -u -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,12 +8,49 @@
>  
>  ---------------------------------------------------------------------------
>  
> +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,11 +61,17 @@
>  This is computed dynamically at bootup.
>  
>  	$ bpatch -r sysptsize
> -	0x9 = 9
> +	0x16 = 22
>  
> -Next, change SYSPTSIZE to a hard-coded value.  Use the bpatch value,
> -plus add 1 for every additional 4MB of shared memory you desire.
> +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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-ports by date

Next:From: David J. MacKenzieDate: 2000-07-07 19:57:47
Subject: Re: PostgreSQL BSDI BSD/OS port
Previous:From: David J. MacKenzieDate: 2000-07-07 14:55:49
Subject: PostgreSQL BSDI BSD/OS port

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group