T
T
tvoyadres2019-10-07 12:04:51
Nginx
tvoyadres, 2019-10-07 12:04:51

How to speed up apache in nginx bundle?

when I run
netstat -na | grep ":443\" | wc -l
and when the number is >= 1000 apache starts to slow down, does not have time to process php requests for the campaign, there seems to be no plugging in mysql, I check through mytop , ngnix seems to cope too, all data is on ssd.
server dual processor xeon 2690 v2, mem 128GB
file limits all raised

<IfModule prefork.c>
StartServers 256
MinSpareServers 256
MaxSpareServers 1024
ServerLimit 8192
MaxClients 4096
MaxRequestsPerChild 32768 
</IfModule>

I would change the server, but the new tredripper has not yet been released

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
tvoyadres, 2019-10-08
@tvoyadres

The issue is resolved, I was directed in the right direction, then I dug up the solution, I
need to set the minimum, since nginx almost drags requests through itself
StartServers 16 MinSpareServers 16
remove the MaxRequestsPerChild 0 restriction, I dug up recommendations over the hill, I didn’t have enough of them, I would set MaxRequestsPerChild 1000000 , but I did not find any information that it is possible.

<IfModule prefork.c>
StartServers 16
MinSpareServers 16
MaxSpareServers 32
ServerLimit 16384
MaxClients 8192
MaxRequestsPerChild 0 
</IfModule>

with this command
netstat -na | grep ":8080\" | wc -l
outputs 4300 connections, I think it will survive 10000 connections with such settings
, it's not clear why some people recommend PHP-FM, if apache can handle it, if configured correctly. It is a pity that there are no normal recommendations anywhere, I hope my research will help someone.

A
Andrey Gavrilov, 2019-10-07
@thexaver

Install fpm, add caching

H
hell, 2019-10-07
@hell

In general, there should not be such brakes on your hardware.
Try to collect query statistics and run them one by one through siedge with 2000 competition.
And fpm is unlikely to give a significant increase - in real applications, both bundles work approximately the same, of course, if Apache is configured correctly.
That's right, in this case, without extra modules, without .htaccess, AllowOverride None, etc.
Look at what's happening with user sessions - they can multiply excessively.
Well, connections to the database - perhaps there is some kind of restriction.
That is, in principle, you need to do something like the following:
1) Clean Apache from everything superfluous.
2) Make a test page by transferring the data from the database to the array and try to run it through siedge (ab does not roll in this case)
3) If the page works without brakes, start it up, but already in dynamics with the data from the DBMS. Compare results
4) If everything goes smoothly here, collect real requests in the nginx logs and try to run them separately through siedge - you may be able to find specific pages on which everything breaks.
5) Watch and profile the code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question