Error 504: all details and solution to the problem

If the server on which your resource is located is overloaded (this occurs due to the exhaustion of the traffic limit), it gives the user the message: “Error 504 gateway time out”. Translated into Russian, this means: "the response time of the gateway has expired, the gateway is not responding." There is a situation when Apache is physically unable to process all http requests and they queue up. However, a time limit passes and a message arrives stating that the request has not been processed.

error 504

To correct the situation, you need to optimize your server. To do this, you need to change the amount of RAM and the number of http (Apache) requests in the direction of their increase. Another option is to optimize the performance of all scripts located on your site. This operation will help increase processing productivity.

If you pay for your hosting, you should immediately contact support for help. The support service is obliged to check your site for any malfunctions and, if possible, “repair” it. Do not neglect this opportunity. The "hole" that needs to be patched may be more than you think. Some hosting providers provide telephone technical support. This type of help is very useful if you are facing for the first time such technical problems as error 504. Thanks to this support, you can learn how to fix them yourself, without any help.

error 504 gateway time out
There is one more reason why a 504 error may occur: a script that executes a command does not fit into the timeframes that are set for it. This may be due to the request of third-party resources, or he himself is engaged in another matter at this time. For example, it builds a search index.
There are two ways to resolve the problem:
1) facilitate the script by optimizing it;
2) increase the value of the PHP parameter max_execution_time.
Once again, I would like to raise the issue of technical support for the hosting provider on which your site is located. Of course, everyone has his own, but the responsibilities of support for everyone are required. There are cases when questions sent to the support service are ignored. Especially if it concerns any lags. For example, the same error 504 occurs. In this case, change the hosting. If more serious problems begin, you are unlikely to be able to count on their help.

504 error

There is one more point that should be mentioned. If your site is located on a free hosting and has a three-level domain, then do not expect your applications to be considered in the near future. First of all, such support works with customers who monthly pay them a place on virtual disks. Of course, there is no reason to condemn them, because regular customers are more important. Therefore, if you want the 504 error to not bother you anymore, go directly to paid hosting. There is no catch in this, by switching to such a package, you will save yourself and your work on the Internet from many undesirable and unpredictable problems.

That's all I wanted to tell you about such a phenomenon as error 504. Let it occur to you as rarely as possible!

Source: https://habr.com/ru/post/B8717/


All Articles