Error 503 Service Temporarily Unavailable
Each account on the server is allocated a certain number of worker processes (Apache mpm-itk workers) that process user requests. Requests arrive at the server and are queued. Light requests are processed quickly, while heavy problematic ones are processed slowly, slowing down the progress of the queue. When the queue length reaches a certain value, the server stops accepting new requests, returning error 503 (Service Temporarily Unavailable, the service is temporarily unavailable). Below are the most common causes of a long queue, as well as ways to solve this problem: 1. A large number of requests to the web server: - The downloaded resource is broken/contains links to too many files (pictures, style sheets, JS scripts), which are loaded through separate requests. Try to combine resources into one file where possible. - An element is installed on the site that periodically sends AJAX requests to the server (for example, chat). The number of requests depends not only on the number of visitors, but also on their habit of opening multiple tabs in the browser. - Using resource elements or scripts on other people’s sites (links to pictures, informer scripts). - DDoS attacks. 2. A large number of “heavy” or damaged CMS components. Check all the components and plugins of your CMS, disabling them one by one, and find the heaviest or damaged ones, which slow down the loading of the site. If possible, discard such components, or look for a faster analogue. Also uninstall any unnecessary components that you do not use or whose use is not necessary. 3. A large number of slow queries to MySQL. Install caching components in the engine that could reduce the number of SQL queries. Optimize SQL queries. Index the database tables by columns that are used in the selection If all else fails, it may be worth changing the engine to a more optimal one. 4. Transferring large static files via PHP. Large static files are best transferred directly, without using scripts. There are two reasons for this: firstly, the running time of the scripts is limited, after which the file transfer is interrupted; secondly, a separate worker process is used to transfer the file via PHP, which means it ceases to participate in the mechanism for processing requests from users. 5. Connection to a remote server. If PHP scripts use Include functions that load parts of the engine located on the same account, make sure that they use a local path and not a URL like "http://...". The presence of a URL forces the server to make an additional HTTP request - this takes up an extra worker process and greatly slows down the loading of the site. 6. Mailing list It is best to place the mailing script launch in the system cron, control of which is located in the control panel. And schedule it to launch at the time of least load on the server (night according to Kyiv and Moscow time).