Website 500 Error - log file Mariadb.service failed
hello community
My website is displaying 500 error, and the log file indicates Mariadb.service failed.
Previously I had to reboot the server a few times due to out of memory issue, but no other change was applied
how do I start debugging the issue
Thank you
1 Reply
Those "Out of memory" errors are very likely the source of your issue. You can read this Community Site post if you'd like to read up on a similar issue. You can run this command to look through your logs for any other out-of-memory messages:
grep -i kill /var/log/messages*
Restarting the Linode can temporarily free up some memory, which is why you saw the error go away after a reboot. However it's likely to happen again, so you'll want to investigate the memory issues further and identify the processes using the most resources. You can use the following command to display memory use on your Compute Instance:
free -m
You can use the following snippet to see a list of your running processes sorted by memory use:
ps -eo pmem,pcpu,rss,vsize,args | sort -k 1 -r | less
Resizing to a larger plan would give you more RAM to work with, so if you'd like to try that you can follow the steps in this guide. Just note that a larger plan would increase your monthly costs - you can check our pricing page to see all of our plans and their respective costs.
That said, resizing may not resolve the issue permanently. A longer-term solution here is to optimize your processes to run better with the resources available to you. For tuning your MariaDB database, I recommend starting with their documentation:
The following guide also presents troubleshooting strategies for when you can't connect to your web server, database, or other services running on your Compute Instance.
The above referenced guide has a specific section titled Analyze service logs which has helpful information for you. For more information about service logs, you can check out these resources: