Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75117 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4071 invoked from network); 27 Jun 2014 15:30:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2014 15:30:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:60315] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/4C-11209-00E8DA35 for ; Fri, 27 Jun 2014 11:30:09 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 2C88241354; Fri, 27 Jun 2014 17:30:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.31] (ppp-93-104-15-92.dynamic.mnet-online.de [93.104.15.92]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id 420D241353; Fri, 27 Jun 2014 17:30:08 +0200 (CEST) To: Ingwie Phoenix Cc: internals@lists.php.net In-Reply-To: <69DDB98B-1874-43BA-B6DB-B878C8E54DBF@googlemail.com> References: <1403777679.12695.14.camel@guybrush> <0DF815F8-5991-46EC-9BD4-53575F774BAC@googlemail.com> <1403860716.12695.34.camel@guybrush> <02B340AD-6EED-497D-85EC-F5C37A7504B6@googlemail.com> <1403878800.12695.58.camel@guybrush> <69DDB98B-1874-43BA-B6DB-B878C8E54DBF@googlemail.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 27 Jun 2014 17:29:28 +0200 Message-ID: <1403882969.12695.97.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Embedding PHP, few additional questions. From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2014-06-27 at 16:53 +0200, Ingwie Phoenix wrote: > > > > Forget Opcache. Get the PHP model of the request based approach > > which > > goes through PHP's complete architecture. opcache comes in in the > > end > > (more or less) easily. > What do you mean by that? It might be my english, but I did not very > much understand what you ment. > You are asking "How can I use opcache in some environment, which I actually don't know" while the actual question should be "What's PHP's internal architecture especially in regards to SAPIs". Opcache fits in, in the end, once the architecture is understood. > Actually, I am indeed scrolling thru pconn. It currently has the most > clean API showcase that I can see, to be very honest. It does a trivial thing, has neither user interaction, nor external systems to interact with. That's one I like to show it as example for these questions. While it's not perfect. But those are details. > But now, you actually finally helped me understand soemthing that I > always wondered: the TSRM_xx macros! Now it makes sense why they are > everywhere, acting as a sort-of mutex…or more, a thing to > differenciate between threads. Always got confused about how this > actually is used - well, now I know. A lesson a day, keeps the > dumbness away, methinks! ^.^ "thread safe resource manager" ... again try to dive in, into the architecture of PHP. > Oh s… That I did not know/consider. So if, for some reason, the PHP > instance crashes or dies, all other instances, and possibly the rest > of the application, dies too? Wow. Guess I should create a watchdog > that keeps track of the service. Well each service should be watched. On good operating systems (note: Solaris ad coming up) you can define contracts in regards to processes the kernel should watch as soon as they misbehave a service manager will be notified and can take action. But well, that's a generic issue, also nodejs/v8 can crash in some situations etc. For a system design the question is: How can you limit the risk and impact. With your design everything is lost and has to be restarted. > The goal is to run websockets, a cdn and db cache together with > HTTP(S). So turning into REST based service would actually make the > structure more complex. You seem to have a different definition of "complex" than me. I consider a monolithic block, mixing multiple language runtimes which follow completely different paradigms ("stay away from threads an use events and be light weight" vs. "have a shared nothing conatainer handling one request after another") and which both are quite sophisticated to be quite complex, whereas I consider an architecture of smaller independent components, which I can maintain, scale, ... independently cleaner. johannes