Re:Modern PHP
by dehrmann on Sunday March 27, 2022 @01:29PM
(#30822104)
Something I pick on with PHP is because requests are so isolated, it doesn't have a good story for pooling SQL and HTTP connections. Its model really limits you when it comes to sharing resources between requests.
[ Parent
| on HN ]
Re:Modern PHP
by francislavoie on Sunday March 27, 2022 @01:42PM
(#30822241)
It's possible to have persistent MySQL connections, but there's all kinds of caveats; MySQL connections are stateful, so bad things can happen, and the performance benefits are only very slight. https://www.php.net/manual/en/features.persistent-connection...
This is indeed a downside but there are workarounds -- The wikimedia foundation put out a good blog post talking about getting HTTP connection pooling for PHP
https://techblog.wikimedia.org/2020/10/26/impact-of-using-ht...
TLDR they used envoy proxy as a sidecar container. So to your point its a pain but still achievable