Apache 502 Error - Server Hang up

13,309

Generally 'Instance Status Check' verifies that your instance's operating system is accepting traffic.

When it fails it means that the operating system inside the instance is not responding to traffic, for example this can happen when a Windows instance hangs or when a Linux instance kernel panics or network is disabled inside the instance.

"502 Bad Gateway" could also be a sign of the webserver not responding in timely manner, which is in line with the fact that CloudWatch has recorded constant 100% CPU usage for your instance.

Given the fact that your instance is a t.micro instance, if the high load is legitimate you may want to consider migrating to a larger instance type like m1.small for example.

Share:
13,309
Rahul Bhansali
Author by

Rahul Bhansali

Updated on June 07, 2022

Comments

  • Rahul Bhansali
    Rahul Bhansali almost 2 years

    I am using EC2 instance (t2 Medium) with Apache, MySQL and PHP. I am getting on regular basis 502(Server Hangup) error. Trying to find a solution from week but didn't able to resolve it.

    I am using mpm_prefork with server config.

    <IfModule mpm_prefork_module>
    
        StartServers             15
    
        MinSpareServers          15
    
        MaxSpareServers          25
    
        MaxRequestWorkers        200
    
        MaxConnectionsPerChild   1000
    </IfModule>
    

    Also not able to see 502 status code in access & error logs.

    Any suggestion will be very helpful.