Closed joanhey closed 4 years ago
@joanhey Thanks report, today i did some tests including the same php, nginx, os versions, but no memory leaks were found.
The ngx_php memory limit of 128M per worker process by default. If the memory is overload, it will be printed in error.log, but not.
At present, we still donot know nothing about this problem. I will add some memory monitoring logs later.
After some tests, the problem is NOT in php-ngx.
The problem is in the nginx.conf
, that it has a too aggressive configuration.
Especially in the number of worker_connections
. That don't affect an nginx alone, but also is not faster with that high number. But affect if it have any embedded language in nginx.
I will investigate a little more and try to explain de results later.
Nginx create worker_connections
at start, not dynamically.
The last nginx.conf
has an overly aggressive in the number of worker_connections
.
Now it's changed and use 4x workers per cpu core. And use a lot less memory and it's faster.
Php-ngx scale really good :) to the maximum 512 concurrent connections. And I think that will be more performant with more concurrent sessions.
PD: The 3 before php-ngx: lithium-postgres, hyper-db and atreugo-prefork-quicktemplate had the maximum req/s with 256 concurrent sessions and degrade the req/s with 512, contrary to php-ngx.
Good joob @rryqszq4 !!!
@joanhey Thanks feedback, great~
Hi
Excessive memory consuption
After updating the Dstats of the benchmark, php-ngx is consuming excessive memory. We need to find where is that problem. Because also affect the performance surely. The servers in Citrine have 32 Gb memory, and php-ngx is using it near to the limit.
https://ajdust.github.io/tfbvis/
Performance
When I tried to use 4x workers per cpu core in php-ngx-pgsql, like we do with Workerman, go and others, php-ngx was unable to start and send this error:
https://tfb-status.techempower.com/unzip/results.2020-02-29-11-51-37-279.zip/results/20200225182242/php-ngx-pgsql/run/php-ngx-pgsql.log
At first I didn't know where was the problem, but now it's clear that is using more memory than the server have.
But php-ngx is performing magnificently :) and still can grow much more in performance.
Thank you