X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A770653921 for ; Tue, 3 May 2005 13:48:36 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64981-04 for ; Tue, 3 May 2005 16:48:30 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by svr1.postgresql.org (Postfix) with ESMTP id 1AE65538B7 for ; Tue, 3 May 2005 13:48:29 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so1877801wri for ; Tue, 03 May 2005 09:48:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=brKElvQ6o0Sq6Nr8pdlBx1HsjLAEV2Gu4PYBzujhCBM2D3fBCQqcEmhtfMEHReoM9hXASojC7x91sYSl5OS+cLxmksKV92slMFXxJtgiNdCO0HtBgAaVkJ75C/0uXihZ+g2k4OkFqUU7KdAwko+mNBxg8VhKCD8aI81HD2ORmXg= Received: by 10.54.99.11 with SMTP id w11mr1192493wrb; Tue, 03 May 2005 09:48:29 -0700 (PDT) Received: by 10.54.86.16 with HTTP; Tue, 3 May 2005 09:48:29 -0700 (PDT) Message-ID: <33c6269f050503094874fbec42@mail.gmail.com> Date: Tue, 3 May 2005 12:48:29 -0400 From: Alex Turner Reply-To: Alex Turner To: Robin Boerdijk Subject: Re: Deep integration of PostgreSQL with Apache Cc: pgsql-general@postgresql.org In-Reply-To: <20050503151626.37630.qmail@web52405.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050503151626.37630.qmail@web52405.mail.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.278 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/117 X-Sequence-Number: 77465 Wouldn't it just be cheaper to buy a second machine than do all of that? Alex Turner netEconomist On 5/3/05, Robin Boerdijk wrote: > --- Thomas Hallgren wrote: > > Robin Boerdijk wrote: > > > Hi, > > > > > > Apologies if this has been discussed before, but I was wondering if > > > there have been any efforts in the past to provide a deep > > integration > > > of PostgreSQL with Apache. What I mean by deep integration is that > > the > > > PostgreSQL server logic runs inside the Apache server processes, > > rather > > > than separate processes. In particular, the postmaster server logic > > > would run inside the Apache master process and the postgres server > > > logic would run inside Apache child processes. > > > > > > The main advantage of this approach would be that it avoids the > > > Apache/PostgreSQL context switch when executing SQL requests from > > the > > > web server. It looks like the Apache server and PostgreSQL server > > > architectures are quite similar to make this feasible. Any > > thoughts? > > > > > The PostgreSQL backend is inherently single-threaded and a new > > process > > is forked each time you establish a new connection (session) so the > > integration you ask for is not in anyway possible unless you are > > content > > with one single database connection. >=20 > I agree that it is not trivial, but is it feasible? Specifically, I'm > thinking about the following approach: >=20 > 1. Strip all networking logic and the logic that manages the postgres > child servers from the postmaster server. The logic that remains is > code that manages the auxiliary processes such as the bgwriter and > statistics collector. Integrate this remaining logic in the the Apache > master server. >=20 > 2. Strip all networking logic from the postgres server. The logic that > remains is logic for executing queries against the database. Integrate > this remaining logic in the Apache child server. >=20 > The result of this is an integrated web/database server where all > networking is handled by Apache instead of postmaster/postgres. Other > than that, I see no difference with the way PostgreSQL works out of the > box. The Apache master server functions as the postmaster (i.e. > managing the child server processes) and the Apache child servers > function as the postgres servers (i.e. access the database). Why would > this web/database server be limited to using only one connection? >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >