[mythtv-users] Mythweb with php 7.2

Mike Hodson mystica at gmail.com
Wed Jun 13 06:35:06 UTC 2018


On Wed, Jun 13, 2018 at 12:11 AM, Stephen Collier <stephenbcollier at gmail.com
> wrote:

> Let me know if you don't get a response. I have a look and see how we do
> it. We both Ubuntu and Redhat at work serving huge web loads. Its a while
> since i set one up, but php being not thread safe is a pain.
>
Kevon, I'm not quite sure how you have your webserver setup, but usually
one uses PHP-FPM and proxy_fcgi (Apache 2.4, if you have 2.2 then you
probably should upgrade) ; you don't leave PHP compiled as a DSO to be
linked into Apache at runtime.

This separation allows for better front-end static file scaling, and PHP in
the FastCGI Process Manager mode is basically a queue of multiple PHP
runners available to take a php request from the webserver each as a
separate process. Since no processes are spawned, simply some inter-process
communication, there is very low latency and far less memory thrashing than
with prefork/CGI and performance pretty much on-par with prefork+DSO.

You could even put the PHP process manager on a wholly different computer
or cluster, and only have a web front-end serving content.  The FPM
connects to Apache with a simple TCP socket.

The other, far less used (but required in very old cases of multithreaded
webservers before FastCGI was a thing, such as Roxen 2....from 2001...yes
I'm old) was to enable the ZTS Zend Thread Safety option upon compiling
PHP.  This would allow you to link the DSO into Apache Event-MPM without it
crashing; but you suffer in performance, because PHP's code was initially
designed to be stateless, and keeping a threaded state while 1 web process
may be handling a ton of requests at a given time, incurs a performance
penalty.

So you can toss out mpm-prefork if you really want to use Event, as long as
you use the PHP-FPM / proxy_fcgi method.   It should stand to be noted that
the vast majority of Distribution-provided PHP installs are NON-threadsafe,
which implies prefork+dso OR CGI OR FPM; to get thread safety you'd need to
very likely compile PHP manually.

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20180613/b185c63f/attachment-0001.html>


More information about the mythtv-users mailing list