Apache server goes down constantly

February 8, 2016 868 views
Ruby on Rails Apache Ubuntu


I have an application under ruby on rails, Apache with passenger and postgresql database, I have the problem that the server is constantly down, to fix this, I have to enter from the terminal to reset the server, digital reports that the server is running at 100%, I think that is running a process in bakground which is doing down the server If someone knows that it can be or have any idea of how to solve it I would be a great help, Thanks a lot.

  • The first thing I'd recommend is to review your apache logs in /var/log/apache2/error.log to see what messages are being recorded when the process exits (if any). You can also use the top command to get an idea of the resources that running processes are using.

  • I have the same issue. For your information, this kind of errors only happen with Digital Ocean. I used to use AWS and it was working o.k even with the same machine configuration

1 Answer

Dealing with resource issues can be difficult. As such, you will want to gather more information and investigate what might be causing the resource issues. Some commands that might help you are:

sudo iotop -abkotn 3 
sudo top -bn1 -o %CPU|head -n 25
sudo netstat -atn|grep :80|awk '{print $6}'|sort|uniq -c

If the iotop command is not installed, you can install it by running this command:

sudo apt-get install iotop

If you do not already have it on your droplet, you might also wish to install the sysstat package. This package includes sar, which logs resource usage for the droplet in timed intervals. It is quite useful for seeing what resources were being used when a droplet crashes or has issues. You can install it via:

sudo apt-get install sysstat

Being it is running via Passenger, you might also want to check the Apache and Passenger logs to see if any recurring errors are causing issues, or if any bad requests are occurring.

Hope it helps,
Jason Colyer
DigitalOcean Platform Support Lead

Have another answer? Share your knowledge.