This KB is to understand what is causing the 503 Error and how to solve the case on your Website
[Fix] 503 Resource limit Exceeded :
If you get 503 Resource exceeded Error on your website it means your website/cPanel account got exceeded the LVE Allocation on the Server,In Shared Environment every cPanel will be allocated with Limited CPU Resources So you should consider contacting your Dev to investigate what is exceeding the Usage.
If you are a WordPress user, You can consider doing the following which will fix the Resource Exceeding. Below we had given the basic and recommended WP Tweaks supported by our Servers
- Enable Litespeed cache from cPanel > Litespeed web cache manager or you can install from WP Admin > Plugins > Add plugins (Kindly remove any other cache plugins you are using and use Only LITESPEED Cache plugin) "Using multiple cache plugins will lead to reducing the Performance"
- Don't use the JETPACK Plugin as it will EAT the Entire Resource of your account
- Don't use any other security plugins for WP Login Protection. As we had already deployment Protection for WP Login pages
- Install Heartbeat Plugin and Do the following Settings WP-Admin > Settings > Heartbeat control > Disable all 3 Options > Save
- Don't Use any sort of Auto optimized plugins which will lead to Overloading the MySQL Resource. As LiteSpeed will do the same job
- Add Cloudflare for Additional protection for your domain to protect from unwanted traffic/attack/bad bot Request
=================
[Fix] 503 Service Unavailable/Not available Error
If you are a WordPress user kindly do the above 5 steps on your WordPress Website
Due to Low PHP Limits, you can face 503 Service not available errors on your websites while doing Theme imports or running scripts for a long time.On this case you can consider increasing the max_execution time and max_input_var from cPanel > Select PHP version > Options
Kindly do the following recommended tweaks to fix the 503 Service not available error
- Kindly use cPanel > Select PHP Version For PHP Version Updates (DON'T USE MULTIPLE PHP MANAGER)
- Increase the max_execution_time and max_input_var variables from cPanel > Select PHP Version > Options (Kindly change the PHP version from native to any other PHP version you need, In order to get the "Options" tab Enabled)
- Remove any php.ini or .user.ini files created by Multiple PHP Manager from your public_html
- Remove any PHP handler coded in the .htaccess rule file from your public_html
Recommended values in cPanel > Select PHP version > Options
max_execution_time = 300 to 1200
max_input_var = -1
Example php.ini, .user.ini, and .htaccess code which should be removed
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php70___lsphp .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
ea-php70 is an example and the value of 70 can be seen like 56,70,71,72,73,74,80,81 (These are PHP Version)
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
php_flag display_errors Off
php_value max_execution_time 300
php_value max_input_time 600
php_value max_input_vars 1000
php_value memory_limit 512M
php_value post_max_size 32M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
php_value upload_max_filesize 32M
php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
php_flag display_errors Off
php_value max_execution_time 300
php_value max_input_time 600
php_value max_input_vars 1000
php_value memory_limit 512M
php_value post_max_size 32M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
php_value upload_max_filesize 32M
php_flag zlib.output_compression Off
</IfModule>
If you find such codes on your .htaccess / .user.ini / php.ini files under your public_html You should consider removing those lines from that file, As these codes are generated by the cPanel > Multiple PHP Manager which is not supported and the main reason for 503 errors on our environment.
If you want to do any changes to your PHP Settings We recommend only you use the cPanel > Select PHP version
If you have any questions you can contact our support