|
|
Posted on 1/16/2022 1:46:40 PM
|
|
|
|

The website program is developed by asp.net core, the browser requests a page, and the server needs to go through the nginx reverse proxy to the .NET program to process, and during the stress test, it will report a 503 error:
503 Service Temporarily Unavailable 503 is an HTTP status code due toTemporary server maintenance or overload, the server is currently unable to process requests。 This condition is temporary and will be restored after some time.
Generally speaking, the 503 error is mostly due to the large number of website visits, resulting in an error caused by excessive traffic or a large number of concurrency.
According to the analysis of the barrel principle, there are many factors that cause performance bottlenecks, first of all, the Linux tuning reference is as follows:
Through professional pressure testing tools, the pressure test results are as follows:
Nginx tuning
worker_processes Set to Automatic, as follows:
Let nginx automatically adjust to your needs.
events settings are as follows:
Use epoll mode to increase the number of concurrent connections, increase the concurrent connection capacity of the nginx system, and set the maximum number of connections that can be opened by workers at the same time. Document Introduction:The hyperlink login is visible.
After tuning, the pressure test is performed, and there is no more 503 error, as shown in the figure below:
If you use an nginx reverse proxy to forward to php-fpm, you may get the following error:
2022/01/16 16:08:01 [crit] 968#0: *12955 open() "/alidata/www/itsvse_web/50x.html" failed (24: Too many open files), client: 100.116.153.2, server:www.itsvse.com, request: "GET /forum.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.itsvse.com" 2022/01/16 16:08:01 [alert] 968#0: *12956 socket() failed (24: Too many open files) while connecting to upstream, client: 100.116.153.109, server:www.itsvse.com, request: "GET /forum.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.itsvse.com" 2022/01/16 16:08:01 [crit] 968#0: *12956 open() "/alidata/www/itsvse_web/50x.html" failed (24: Too many open files), client: 100.116.153.109, server:www.itsvse.com, request: "GET /forum.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.itsvse.com"
Set the worker_rlimit_nofile parameters as follows:
Documentation:The hyperlink login is visible.
(End)
|
Previous:The difference and connection between Ubuntu, CentOS, and RedHatNext:OceanBase Database Management Tool Download
|