Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83634 invoked from network); 13 Sep 2010 13:56:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2010 13:56:36 -0000 Authentication-Results: pb1.pair.com header.from=dennis.hotson@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=dennis.hotson@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dennis.hotson@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:57456] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/94-57839-29D2E8C4 for ; Mon, 13 Sep 2010 09:56:35 -0400 Received: by wwb39 with SMTP id 39so4104696wwb.11 for ; Mon, 13 Sep 2010 06:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=1o32ugakD4xs+5WRqlylTK9AJ4v8H3w2qkPPqXiSzE4=; b=NBNbVeyDr3zZuZFzMVZBkjP4eWQuIuNLjZSUGlDBAH+JfSkYESrny6up7N0ISBQzeW vF9J/4V1UOX/8EO9QtiYV+IQ+Asg+5yFh8+AxAchfJop5nKV/PWMuMVqBqXHyM6xZldg Mmd/DGtdXmZLjBfoVMXFPZWYFotzNaT/q4tzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=mjcZj7aijzHniglWjEAVZDW0SQrqskigBzNOcfho0KVut4FeKM/l4TADRgnnR7dG2m K5Gs7UmU1fCFoPvokHmFMDKu8a/ZPTajRRwMZFM1OWbFMup2v0MbO+U2wrKYHlFkgIGj FIGTZ05G1o2MzDARNaMekVfvpZSlHI2UtWbVM= MIME-Version: 1.0 Received: by 10.227.23.213 with SMTP id s21mr1418220wbb.84.1284386191730; Mon, 13 Sep 2010 06:56:31 -0700 (PDT) Received: by 10.227.69.212 with HTTP; Mon, 13 Sep 2010 06:56:28 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Sep 2010 23:56:28 +1000 Message-ID: To: FGM at GMail Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=002215b0393eb6688904902476f2 Subject: Re: [PHP-DEV] WSGI-like SAPI for PHP ? From: dennis.hotson@gmail.com (Dennis Hotson) --002215b0393eb6688904902476f2 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 13, 2010 at 10:24 PM, FGM at GMail wrote: > Hello, > > Having to do some work in Python recently, I had to dig into WSGI and found > that its model, much similar to what JSGI, PSGI, Rack do, seemed likely to > bring a potentially high performance improvement on my usual (Drupal) > environment. This also happened to match a remark done by Rasmus during his > presentation in late August at Drupalcon CPH, in which he advised us to > evolve Drupal towards a model with a long-term application process - PHP or > not, apparently not in his idea (C ?) - to avoid the massive amount of time > and effort currently spent on our per-page bootstrapping process, and > return > PHP userland code to the more "templating" parts of the CMS. > > However, after digging around on the list archives and elswhere, I could > find no trace of a discussion about an approach like this one. CGI/FCGI > sure, FPM sure, but nothing like WSGI. The closest approximation appears to > be the WPHP package, which does indeed embrace PHP within actual WSGI, but > does so at the cost of a fork/exec per hit, definitely the opposite of the > goal being looked for. > > Has there ever been such a discussion, if only to dismiss the prospect as > incompatible with PHP/ZE ? Any pointers to more information would be > appreciated. > Have you seen this? http://github.com/indeyets/appserver-in-php I also had a crack at implementing a web server in PHP. It's inspired by Ruby's Rack and even uses the mongrel HTTP parser: http://github.com/dhotson/kelpie .. mine is mostly just a toy and hasn't been thoroughly tested, but I did manage to halve my app's average response time without even really trying. The main advantage of the app server approach is that you can do your framework init stuff once at server startup instead of every single request, which can be a pretty huge saving. The main problem is that PHP isn't very good at long running processes. Also worth checking out: http://mongrel2.org - Dennis Hotson --002215b0393eb6688904902476f2--