Reprint article Source: http://www.111cn.net/sys/nginx/90669.htm (if invasion delete)
Nginx Newspaper 504 Gateway Timeout error caused, one is the file configuration problem, the other is related to the length of processing, and finally there may be insufficient resources, the following we look at.
Explained as follows:
Recently in the work, the need to do Exce
Recently in the work, the need to do Excel import function, because of the Excel data is more, and our server program needs to check the content of the data, will call a lot of external service interface, so no suspense import Excel interface call more than a minute, and error: 504 Gateway Timeout Here are two ways to solve this problem:
1. Optimize business cod
Yesterday, a program needs to export 500 data, the results found that 150 is, Nginx reported 504 Gateway timeout errorIt was observed that time-outs of about 30 seconds were found, and the execution times in php.ini were 300 seconds:Copy CodeThe code is as follows:Max_execution_time = 300Re-check the relevant configuration of nginx, no fruit.I wrote a test page f
Yesterday, a program needs to export 500 data, the result found that 150 is, Nginx reported 504 Gateway timeout error
After observation, it was found that about 30 seconds timed out, the execution time in php.ini is 300 seconds:
Copy Code code as follows:
Max_execution_time = 300
Check the related configuration of nginx, no fruit.
wrote
Recently, server downtime occurs frequently. When I get off work, G crashes and 502 Bad Gateway Nginx reminds me of the previous 504 Gateway Time-out, the two should be in a certain relationship. Nginx 504 Gateway Time-out means that the requested
504 gateway time-out
Problem:
The requested gateway does not have a request. In short, it does not have a request for PHP-CGI that can be executed.
In general, this situation may be caused by the small buffer of nginx's default FastCGI process response, which will cause the FastCGI process to be suspended. If your FastCGI service does not handle this suspension w
Recently, the phenomenon of server downtime more frequent, temporary work, G to hang up, 502 Bad Gateway Nginx, I can not help but remind me before the 504 gateway time-out, the two should be a bit of contact, we must find out. The implication of Nginx 504 Gateway time-out i
504 Gateway time-out issues common to Web sites that use Nginx as a Web serverI met this problem when I was upgrading the Discuz forum.In general, this situation may be due to the Nginx default fastcgi process response buffer is too small, which will cause the fastcgi process to be suspended, if your fastcgi service is not good for this suspend processing, then it is very likely to cause
504 gateway time-out problems are common in websites that use nginx as the Web server.
I encountered this problem when upgrading the discuz forum.
In general, this situation may be caused by the small buffer of nginx's default FastCGI process response, which will cause the FastCGI process to be suspended. If your FastCGI service does not handle this suspension well, in the end,
Today the program in the execution of an Excel export task, there is an Nginx timeout promptNginx 504 Gateway Time-outTroubleshooting process:View the task discovery content is a data volume 20,000 information each piece of information has 50 fields when you perform the export to Excel, the problem occursExecution time expires in about 10 minutesAnalysis:The impl
Do site students often find some Nginx server access when prompted 504 Gateway time-out error, generally by the Nginx default fastcgi process response slow, but there are other situations, here I summed up some solutions for your reference.Method/Step
Situation one: Due to nginx default fastcgi process response buffer too small causedThis situation causes the FASTCGI process to be suspended, and if the
Problem
Win7 installed on the nginx1.6.2 official website version + Wamp PHP Library, and then the program has PHP use Curl to collect a remote program, but always appear 504 Gateway Time-out prompt! Using PHP inside Wamp, no php-fpm, how to modify max_children parameters?
Startup code
@echo offREM Windows 下无效REM set PHP_FCGI_CHILDREN=5REM 每个进程处理的最大请求数,或设置为 Windows 环境变量set PHP_FCGI_MAX_REQUESTS=1000echo Sta
Recently, an nginx WEB server was built under centos, but some friends said that the following errors often occur:
504 Gateway Time-outThe server didn't respond in time.
The lnmp configuration in CentOS basically uses the same configuration file and has never encountered any problems. After installing the same environment on a vps recently, when the website is online for more than 10 people, the open speed
}
....Proxy_pass http://apachephp;
Replace into
Copy Code code as follows:
Upstream PHP {
Server 127.0.0.1:9000;
}
...Fastcgi_pass PHP;
You can move Apache running PHP to PHP-FPM to run.
I thought this would be a peace of the day, and the migration is really no problem, but if you don't analyze the root cause of the problem. The problem will come to the door, the next day Nginx also reported 504 of the
The Uwsgi+nginx deployed Web site runtime may produce errors such as 504 Gateway time out, due to improper setting of the relevant parameters.Nginx and Uwsgi integration with three parameters can be used to set the time-out period, in the Nginx configuration file http->server->location set.Uwsgi_connect_timeout: The default is 60 seconds, and the timeout for the
Analysis
504 Gateway Time Out
The reason is that because of the improper setting of the relevant parameters, it is easy to solve
When Nginx and UWSGI are integrated, there are three parameters that can be used to set the timeout time:
1.uwsgi_connect_timeout:
The default is 60 seconds, and the time-out for the Uwsgi-server connection, which cannot exceed
Using PHP today to execute a very time-consuming file "PS: self-useful, about 3 minutes"But the execution is shown after one minuteNginx 504 Gateway Time-outSo modify Max_execution_time = 1200 in the php-ini.php, restart PHP, or no useSuddenly understand that if the timeout is a problem with PHP settings, the following error will be reportedFatal error:maximum ex
) processes, with more than 4 GB of memory.
The server can start 200 processes.
2. Change request_terminate_timeout to 60 s, so that the timeout time for the PHP-CGI process to process the script is 60 seconds, which can prevent the process from being suspended.
To improve utilization efficiency.
Modify the nginx. conf file as follows:
The Code is as follows:Fastcgi_connect_timeout 60;
Fastcgi_send_timeout 180;
Fastcgi_read_timeout 180;
When using Nginx as a Web server, you will often encounter 504 Gateway time-out error prompts. After research, basically can be determined that this error in most cases is not related to Nginx itself, the root of the problem is nginx to submit the parsing of PHP to the backend php-fpm process, due to improper configuration of the fastcgi parameters caused by a series of problems.Through the query related da
In general, this situation may be due to the Nginx default fastcgi process response buffer too small, which will cause the fastcgi process to be suspended, if your fastcgi service to this suspend processing is not good, then it is very likely to cause the 504 Gateway Time-outNow the site, especially some forums have a lot of replies and a lot of content, a page even has hundreds of KThe default fastcgi proc
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.