Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74854 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35208 invoked from network); 11 Jun 2014 20:15:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jun 2014 20:15:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=swhitemanlistens-software@cypressintegrated.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=swhitemanlistens-software@cypressintegrated.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cypressintegrated.com designates 173.1.104.101 as permitted sender) X-PHP-List-Original-Sender: swhitemanlistens-software@cypressintegrated.com X-Host-Fingerprint: 173.1.104.101 rproxy2-b-iv.figureone.com Received: from [173.1.104.101] ([173.1.104.101:50758] helo=rproxy2-b-iv.figureone.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/A8-09240-9C8B8935 for ; Wed, 11 Jun 2014 16:15:06 -0400 Received: from 124.1.168.192.in-addr.arpa ([108.12.130.219]) by rproxy2-b-iv.figureone.com (Brand New Heavy v1.0) with ASMTP id XAA42002 for ; Wed, 11 Jun 2014 13:15:02 -0700 Date: Wed, 11 Jun 2014 16:14:53 -0400 Reply-To: Sanford Whiteman X-Priority: 3 (Normal) Message-ID: <301741007.20140611161453@cypressintegrated.com> To: Kevin Ingwersen In-Reply-To: <7E0ACCCC-54E6-4CAC-9813-4FF86E0F55C4@googlemail.com> References: <2C3AA922-B514-45C0-940E-EBF6F931BCE1@googlemail.com> <557316051.20140611021641@cypressintegrated.com> <7E0ACCCC-54E6-4CAC-9813-4FF86E0F55C4@googlemail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Own webserver, with PHP plus opcache/similar? From: swhitemanlistens-software@cypressintegrated.com (Sanford Whiteman) > I am thinking about the difference of using a remote process, or > writing my own SAPI ontop of the Embed-SAPI - maybe making a C++ > module to nodejs, so I can kick requests and thei rhandles into a > different thread, and have nodjs interact directly with PHP, rather > than a process. I dont know though, how efficient that is, when > looking at caching. > Do you think I should rather spawn an array of php workers (and if, > -cgi or -fpm?) or write my own layer using the Embed SAPI? I feel the Embed SAPI is better for your case. The FastCGI protocol is built for the classic HTTP request/response cycle, not for Websockets' continuous bidirectional pump. You would find yourself synthesizing HTTP-like requests just to interact with FCGI. That way madness lies. I think for the goal "Process websocket messages in PHP code," assuming no time/technical limitations, you should lean as little on other protocols as possible. Sticking to the websocket server's async I/0 model, with PHP loaded into its memory space so you can write in a familiar language, would be ideal. Note I do not know which, if any, opcode caches will load under the Embed SAPI. You have a lot of moving parts here. -- S.