Re: [GENERAL] fork() bad

From: "K(dot)T(dot)" <kanet(at)calmarconsulting(dot)com>
To: "Richi Plana" <richip(at)mozcom(dot)com>, "Herouth Maoz" <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] fork() bad
Date: 1999-03-22 21:48:38
Message-ID: 001401be74ad$c4fafd60$43d8a5ce@p2-400-death
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Add another tier btwn your client (the forked processes) and the server to
handle database requests. It will allow you to govern the number of
connections plus leave connections open so you are not constantly closing
and opening new ones.

-----Original Message-----
From: Richi Plana <richip(at)mozcom(dot)com>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql-general(at)postgreSQL(dot)org <pgsql-general(at)postgreSQL(dot)org>
Date: Monday, March 22, 1999 11:26 AM
Subject: Re: [GENERAL] fork() bad

>Hi, Herouth.
>
>On Mon, 22 Mar 1999, Herouth Maoz wrote:
>
>|o| > As some of you may know, I'm hacking Ascend RADIUS 2.01 to look up a
>|o| > PostgreSQL database for authentication and log to PG for accounting.
>|o| > Normally, RADIUS fork()s once for Accounting and fork()s for each
>|o| > Authentication request. That's a lot of fork()ing and establishing
>|o| > connections to the backend. It's slow, but it's better than junking
>|o| > whatever code I've written so far.
>|o| >
>|o| > If anyone can give a better suggestion, I'm all ears. Also, if anyone
>|o| > wants the code when it's done, try asking. ;^)
>|o|
>|o| Why don't you try to synchronize access to the connection between the
>|o| various processes? You know, lock it in an exclusive lock, on an
>|o| inter-process basis, such that when one process accesses it, the others
>|o| have to wait. Or you can have a few connections open, so that the
>|o| bottleneck is wider. You know, like you would treat any shared object
in an
>|o| inter-process environment?
>
>It kinda defeats the purpose of allowing RADIUS to fork() if I do locking.
>I've no benchmarks to prove it, but if I allow it to execute one process
>at a time via locking, that would probably slow the other processes down.
>(ie. Should the waiting process block? If so, when will it try again? Are
>the overheads to establishin a connection really that big?)
>
>
>L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,-
>LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / /
>LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / /
>LLLLL mailto:richip(at)mozcom(dot)com `-'-' `-'-' `-'-' `-'-'
>------------------------------------------------------------------------
>P G P Key available at http://www2.mozcom.com/~richip/richip.asc
>Tired of Spam? Join this CAUCE! http://www.cauce.org/
>
>

Browse pgsql-general by date

  From Date Subject
Next Message K.T. 1999-03-22 21:56:23 Re: [GENERAL] Extensive PostgreSQL queries in PHP scripts causing browser error?
Previous Message Charles Hornberger 1999-03-22 19:41:01 Extensive PostgreSQL queries in PHP scripts causing browser error?