Restart on Task Hang


Sometimes on a Linux server, particularly if there isn't enough memory allocated on a server or the tasks being queued cannot be done with the available resources over a period of time, tasks may hang on the server. This can be fatal and cause the server to become unresponsive.

To setup the server so it restarts if this occurs automatically you need:

Login to SSH

To make these settings live without rebooting type:
sysctl kernel.panic=5
sysctl kernel.hung_task_panic=1
sysctl vm.panic_on_oom=1

Edit the configuration file so the changes will also occur after a reboot type:
pico /etc/sysctl.conf

Add the following to the bottom of the file

# Reboot 5 seconds after panic
kernel.panic = 5

# Panic if a hung task was found
kernel.hung_task_panic = 1

# Panic if OOM-Killer is initiated vm.panic_on_oom = 1

To save Press: CTRL O
To exit Press: CTRL X 


Was this answer helpful?

Still need help?

Our friendly support team are ready to offer assistance with any issues you may be encountering.
Click the button below to open a ticket:
Open Ticket

 WordPress Hosting

Fast hosting for WordPress
Experience the best in Australian WordPress hosting with lightning fast servers, built-in caching, and performance tools.

 Build Your Website

Sitejet Hosting
Build your site fast with a drag and drop editor with no coding required. 140+ quality, templates to get you started.

 Register Domains

It all starts with your domain name
Find the perfect domain and register now with our competitive pricing on all extensions.

 Web Hosting

Fast, local, secure hosting
Full featured hosting on cPanel with multiple server locations around the country.
« Back