Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40512 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96993 invoked from network); 14 Sep 2008 20:56:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Sep 2008 20:56:31 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:54714] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/C1-11861-D7A7DC84 for ; Sun, 14 Sep 2008 16:56:30 -0400 Received: from [83.228.56.37] (port=4969 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1Keydu-0005Lz-72 for internals@lists.php.net; Sun, 14 Sep 2008 15:56:26 -0500 Message-ID: To: References: <54.9F.33739.7631DC84@pb1.pair.com> Date: Sun, 14 Sep 2008 23:56:13 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] PHP Suspendable requests for Apache From: sv_forums@fmethod.com ("Stan Vassilev | FM") > On Sun, Sep 14, 2008 at 5:33 PM, Rustam Abdullaev > wrote: >> Hi, >> >> Is anyone working on a suspendable request support in PHP when used as a >> module in Apache? >> >> Suspendable requests are great for supporting Server Push technology, but >> are currently only supported in Jetty and Tomcat. >> >> The API would be extremely simple, for example: >> >> suspend(string request_id, int timeout); >> - this would end the current request but keep the client connection open >> up >> to "timeout" seconds. >> >> resume(string request_id); >> - this would resume a suspended request by starting a new PHP request but >> reusing the same client connection that was previously suspended Two ideas: First is, for a rough approach that works today: you can emulate this by polling from the suspended process by sleeping for, say, 400ms and checking a shared value for a flag whether to resume. Second and most important though, Apache isn't architected to handle long running processes inside a request, as it typically uses a limited pool of threads/processes to serve requests, if enough requests in the pool are held up suspended, it would prove heavily detrimental to the server performance (this is why "push" technologies like Comet are not recommended on Apache). I would possibly suggest the requests communicating with (for example), long running background processes running from shell from that purpose, using standard interprocess communication like unix sockets.