Re: [GENERAL] Re: [HACKERS] postgres processes

From: wieck(at)debis(dot)com (Jan Wieck)
To: kdebisschop(at)spaceheater(dot)infoplease(dot)com
Cc: rems(at)gdansk(dot)sprint(dot)pl, jwieck(at)debis(dot)com, pgsql-general(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Re: [HACKERS] postgres processes
Date: 1999-06-14 10:10:01
Message-ID: m10tTgn-0003kiC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Karl DeBisschop wrote:

> From: Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl>
>
> My problem is, that server is used not only as database server, but also
> (and in general) as mail server - I think that tehre are some other
> services too.
> I've used persistent connections to database (and I think I now understand
> why so big processor usage), so postgres processes haven't die after
> serve requests but wait for another.
> Hmm... I have one question more - every postgres process takes about 5% of
> processor time ( I've used to measure top command ) - it is normal or may
> be processor is too slow?
>
> We use a similar configuration, and initially had similar problems.
> We just don't use persistent connections in php anymore, and things
> work fine - In our case, the number of reconnects saved by pconnect
> would be small anyway.
>
> Another strategy would be to start a second apache server on a
> different port or different machine, use it only for redirects to the
> pages that call postgres (assuming this is not your whole site). Then
> throttle the second server back as described above (we haven't
> actually done this - but it seems it should work).

I don't know anything about the internals of php, but I have
similar problems with an Apache module I'm (still) writing.

Using Apache 1.3.3 I've tried to use persistent connections
to a content server. The methods available for a module
include a call AtExit, which is called just before the actual
Apache server process will be terminated (due to Apache
shutdown or because too many spare servers).

But there's nothing that tells about a timeout. In the case
of a communication or scripting timeout, Apache does a
longjmp() back into the mainloop and clears the pool. That's
the reason why sockets, files and memory allocations under
Apache should be done via the Apache pool utilities, and not
using the low level functions (as in PostgreSQL with
palloc()).

It MIGHT be the case, that php has that problem when using
persistent database connections and that after a timeout, an
unclosed connection is hanging around causing another hanging
PostgreSQL backend.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sascha Schumann 1999-06-14 11:05:31 Re: [GENERAL] Re: [HACKERS] postgres processes
Previous Message Jim Mercer 1999-06-14 09:39:05 Re: [GENERAL] vacuum fails

Browse pgsql-hackers by date

  From Date Subject
Next Message David R. Favor 1999-06-14 10:40:44 Postgres mailing list search engine is down
Previous Message Tatsuo Ishii 1999-06-14 08:19:42 Re: [HACKERS] libpq/conv.c