Re: [HACKERS] Re: Max backend limits cleaned up - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: Max backend limits cleaned up
Date
Msg-id 16011.920761599@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: Max backend limits cleaned up  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: Max backend limits cleaned up
List pgsql-hackers
>> I am thinking, though, that we also ought to have FAQ entries under
>> headings like:
>> I get "IpcSemaphoreCreate: semget failed (No space left on device)"
>> when I try to start the postmaster
>> I get 'Sorry, too many clients already' when trying to connect
>> 
>> If you like, I'll try to write up a first cut at these.

> Sure.

Attached are some proposed diffs against the copy of the FAQ that's
currently in CVS ... not sure if that is the master copy or not.
        regards, tom lane

*** FAQ~    Sat Mar  6 17:10:05 1999
--- FAQ    Sat Mar  6 18:00:22 1999
***************
*** 59,66 ****    2.10) All my servers crash under concurrent table access. Why?    2.11) How do I tune the database
enginefor better performance?    2.12) What debugging features are available in PostgreSQL?
 
!    2.13) How do I enable more than 64 concurrent backends?
!    2.14) What non-unix ports are available?                                Operational questions
                
 
--- 59,67 ----    2.10) All my servers crash under concurrent table access. Why?    2.11) How do I tune the database
enginefor better performance?    2.12) What debugging features are available in PostgreSQL?
 
!    2.13) When I try to start the postmaster, I get IpcSemaphoreCreate errors.
!    2.14) I get 'Sorry, too many clients' when trying to connect.
!    2.15) What non-unix ports are available?                                Operational questions
                
 
***************
*** 384,391 ****    You either do not have shared memory configured properly in kernel or    you need to enlarge the
sharedmemory available in the kernel. The    exact amount you need depends on your architecture and how many
 
!    buffers you configure postmaster to run with. For most systems, with
!    default buffer sizes, you need a minimum of ~760K.       2.7) I have changed a source file, but a recompile does
notsee the change?   
 
--- 385,393 ----    You either do not have shared memory configured properly in kernel or    you need to enlarge the
sharedmemory available in the kernel. The    exact amount you need depends on your architecture and how many
 
!    buffers and backend processes you configure postmaster to run with.
!    For most systems, with default numbers of buffers and processes, you
!    need a minimum of ~1MB.       2.7) I have changed a source file, but a recompile does not see the change?   
***************
*** 420,426 ****    If you are doing a lot of inserts, consider doing them in a large    batch using the copy command.
Thisis much faster than single    individual inserts. Second, statements not in a begin work/commit
 
!    transaction block are considered to be their in their own transaction.    Consider performing several statements
ina single transaction block.    This reduces the transaction overhead. Also consider dropping and    recreating
indiceswhen making large data changes.
 
--- 422,428 ----    If you are doing a lot of inserts, consider doing them in a large    batch using the copy command.
Thisis much faster than single    individual inserts. Second, statements not in a begin work/commit
 
!    transaction block are considered to be in their own transaction.    Consider performing several statements in a
singletransaction block.    This reduces the transaction overhead. Also consider dropping and    recreating indices
whenmaking large data changes.
 
***************
*** 482,494 ****    pgsql/data/base/dbname directory. The client profile file will be put    in the current directory.
 
 
!   2.13) How do I enable more than 64 concurrent backends?
!   
!    Edit include/storage/sinvaladt.h, and change the value of
!    MaxBackendId. In the future, we plan to make this a configurable
!    prameter.    
!   2.14) What non-unix ports are available?       It is possible to compile the libpq C library, psql, and other
interfacesand binaries to run on MS Windows platforms. In this case,
 
--- 484,530 ----    pgsql/data/base/dbname directory. The client profile file will be put    in the current directory.
 
 
!    2.13) When I try to start the postmaster, I get IpcSemaphoreCreate errors.
! 
!    If the error message is "IpcSemaphoreCreate: semget failed (No space left
!    on device)" then your kernel is not configured with enough semaphores.
!    Postgres needs one semaphore per potential backend process.  A temporary
!    solution is to start the postmaster with a smaller limit on the number of
!    backend processes (use -N with a parameter less than its default, 32).
!    A more permanent solution is to increase your kernel's SEMMNS and SEMMNI
!    parameters.
! 
!    If the error message is something else, you might not have semaphore
!    support configured in your kernel at all.
! 
!    2.14) I get 'Sorry, too many clients' when trying to connect.
! 
!    You need to increase the postmaster's limit on how many concurrent backend
!    processes it can start.
! 
!    In Postgres 6.5, the default limit is 32 processes.  You can increase it
!    by restarting the postmaster with a suitable -N value.  With the default
!    configuration you can set -N as large as 1024; if you need more, you'll
!    need to increase MAXBACKENDS in include/config.h and rebuild Postgres.
!    You can set the default value of -N at configuration time, if you like,
!    using configure's --with-maxbackends switch.
! 
!    Note that if you make -N larger than 32, you should consider increasing
!    -B beyond its default of 64.  For large numbers of backend processes,
!    you are also likely to find that you need to increase various Unix kernel
!    configuration parameters.  Things to check include the maximum size of
!    shared memory blocks (SHMMAX), the maximum number of semaphores (SEMMNS and
!    SEMMNI), the maximum number of processes (NPROC), the maximum number of
!    processes per user (MAXUPRC), and the maximum number of open files (NFILE
!    and NINODE).  The main reason that Postgres has a limit on the number of
!    allowed backend processes is so that you can ensure that your system
!    won't run out of resources.
! 
!    In Postgres versions prior to 6.5, the maximum number of backends was
!    64, and changing it required a rebuild after altering the MaxBackendId
!    constant in include/storage/sinvaladt.h.    
!   2.15) What non-unix ports are available?       It is possible to compile the libpq C library, psql, and other
interfacesand binaries to run on MS Windows platforms. In this case,
 


pgsql-hackers by date:

Previous
From: James Thompson
Date:
Subject: Re: [HACKERS] CVS access?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] CVS access?