Benchmarking of PHP application with php-fpm vs swoole/openswoole

Benchmarking of PHP application with php-fpm vs swoole/openswoole

How realistic is this benchmark? Before people start pulling out pitchforks from their basements (sheds, whatever) – I do realize this is a rather NOT a realistic test-case scenario. In the real life scenario, it is somewhat unlikely your API will just be serving some static json responses without any io calls. And even a … Read more

Mezzio php framework – setting up with php-fpm and nginx reverse proxy (with docker containers and docker compose)

This article is about mezzio+php-fpm, if you are looking for mezzio+swoole -> see this post here. There are many reasons why you may want to use nginx reverse proxy in front of your application – (such as mezzio php framework with php-fpm). Reasons to use nginx with your php-fpm applications: efficient serving of static assets … Read more

Mezzio php framework – using swoole/openswoole with nginx reverse proxy (with docker containers and docker compose)

There are many reasons why you may want to use reverse proxy in front of your application – (such as mezzio php framework with swoole/openswoole). Reasons to use nginx with your php+swoole/openswoole applications: efficient serving of static assets – while swoole will serve it very efficiently, but it will never beat raw compiled performance of … Read more

PHP Swoole setcookie urlencode and base64 alternative

One issue Ive ran into recently: Swoole and Openswoole use urlencode to encode cookies when one invokes Swoole\Http\Response->cookie() method instead of rawurlencode. While swoole offers an alternative in form of rawCookie ( and then you could encode value as you wish) – not all depnedent frameworks and libraries support that: https://openswoole.com/docs/modules/swoole-http-response-cookie Some popular PHP libraries … Read more

Swoole – solve “WARNING Worker_reactor_try_to_exit() (ERRNO 9012): worker exit timeout, forced termination”

I’ve recently ran into this error message with mezzio/swoole – which would popup for every hot reload on code change. Ive tried couple of different things (completely on the hunch) like: disabling ticks (this didn’t help) disabling side swoole processes (this didn’t help) raising max_wait_time to 60 seconds (this didn’t help) checking mysql/redis connection pools … Read more