PostgreSQL and mod_perl trouble (spinlock)

Поиск
Список
Период
Сортировка
От Patrick Verdon
Тема PostgreSQL and mod_perl trouble (spinlock)
Дата
Msg-id 36AB574E.D2E1229B@kan.co.uk
обсуждение исходный текст
Ответы Broken Link  (Egon Schmid <eschmid@stuttgart.netsurf.de>)
Список pgsql-general
Hi,

I've been doing some benchmarking with PostgreSQL
under mod_perl and I've been getting some rather
disturbing results. To achieve the maximum benefit
from persitent connections I am using a method
called 'connect_on_init' that comes with a Perl
module called Apache::DBI. Using this method,
when the Web server is first started - each child
process establishes a persistent connection with
the database. When using PostgreSQL as the database,
this causes there to be as many 'postgres'
processes are there are 'httpd' processes
for a given database.

As part of my benchmarking I've been testing the
number of httpd processes that my server can
support. The machine is a 450 MHz PII/256 MB RAM.
As an excercise I tried to start 100 httpd
processes. Doing this consistently results in the
following PostgreSQL errors and the backend usually
dies:

IpcSemaphoreCreate: semget failed (No space left on device) key=5432017, num=16, permission=600
NOTICE:  Message from PostgreSQL backend:
    The Postmaster has informed me that some other backend died abnormally and possibly corrupted shared memory.
    I have rolled back the current transaction and am going to terminate your database system connection and exit.
    Please reconnect to the database system and repeat your query.

FATAL: s_lock(28001065) at spin.c:125, stuck spinlock. Aborting.

Note that the 'no space left on device' is
misleading as there is a minimum of 400 MB
available on each file-system on the server.

This is obviously bad news, especially as we are
hoping to develop some fairly large-scale
applications with PostgreSQL. Note that this
happens when connecting to a single database.
We were hoping to connect to several databases
from each httpd process!!

The frustrating thing is we have the resources.
If I only start 30 processes (which seems to be
the approximate limit) there is about 100 MB
of RAM that is not being used.

Are there any configuration values that control
the number of postgres processes? Do you have
any idea why this is happening?

Is anyone else using Apache/mod_perl and PostgreSQL
successfully in a demanding environment?

Any help would be greatly appreciated.

Cheers.



Patrick

--

#===============================#
\  KAN Design & Publishing Ltd  /
/  T: +44 (0)1223 511134        \
\  F: +44 (0)1223 571968        /
/  E: mailto:patrick@kan.co.uk  \
\  W: http://www.kan.co.uk      /
#===============================#

В списке pgsql-general по дате отправления:

Предыдущее
От: "Paolo P. Lo Giacco"
Дата:
Сообщение: ...
Следующее
От: Egon Schmid
Дата:
Сообщение: Broken Link