Home > Article > Backend Development > What is php 503 error?
php 503 error is due to temporary server maintenance or overload. The server is currently unable to process the request. This situation is temporary and will recover after a period of time. If the delay time can be expected, the response can include A [Retry-After] header is used to indicate this delay time.
php 503 error is:
Definition:
503
is an HTTPS status code. The English name 503 Service Unavailable and 404 (404 Not Found) are the same web page status error code. The former is a return status when a server error occurs, and the latter is a status returned when a web page program has no relevant results. When optimizing a website, it is usually necessary to create a 404 error page for overall optimization of the website.
Due to temporary server maintenance or overload, the server is currently unable to process the request. This condition is temporary and will be restored after a period of time. If the delay time can be estimated, the response can include a Retry-After
header to indicate the delay time. If this Retry-After
information is not given, the client SHOULD handle it the same way it handles a 500 (Server Internal Error) response.
Cause:
1. The web page appears
1. The network administrator may close the application pool to perform maintenance.
2. The application pool queue is full when the request arrives.
3. The application pool identification does not use the predefined account: network service, and the identification is configured by itself, but the configured user does not belong to the IIS_WPG
group
4. The application pool has CPU monitoring enabled, and has been set to shut down the application pool if the CPU utilization exceeds a certain percentage. However, the server-side pages (.asp, .aspx) written by developers are not efficient in execution and will cause long-term CPU usage. Eventually the set percentage is reached, causing the application pool to shut down
5. The value filled in the request queue limit of the performance tab of the application pool is too small, and the default is 1000.
6. The value set for the appRequestQueueLimit
property of the system.web/httpRuntime
node in web.config
is too low.
2. Host site
There are two main reasons:
1. The site is being attacked. The latest type of attack is actually a derivative of DDoS. The principle is to find thousands of IPs, send requests to the server's apache at the same time, and then immediately disconnect, leaving apache in a waiting state, causing all apache threads to be filled up, resulting in The server is down.
Therefore, in order to ensure the interests of most customers, we have set a limit of 64 php requests per 19 seconds for each space. Note that this is a php request, general image requests and html requests are not included.
2. This program occupies too many PHP threads. Some programs are not well optimized and can generate several or even dozens of PHP threads with one click. In this case, a few clicks can fill up all 64 PHP threads in that period. Hence the 503 error. It is recommended to optimize the program and use require (meaning "request") and other statements as little as possible.
Related learning recommendations: PHP programming from entry to proficiency
The above is the detailed content of What is php 503 error?. For more information, please follow other related articles on the PHP Chinese website!