SQL issue

Hi,

I have an app and a website that I have running on my linode, both are currently not released and in the trial phase. Lately something strange has started happening with both of them simultaneously.

Background

I have an image and video sharing app that's going to come out.

Issue

The app works fine at one time and in a flash the link between the app and sql gets terminated. Upon restarting mysql it works fine but only for a while and crashes again. Whenever the app goes down, at the same time the website also goes down. stating 'cannot connect to database'

Linode support states that the Linode is running out of memory.

The app and the site are completely empty and with only 2-3 test users, so overloading of the services in any way is out of the question.

Could anyone please help me out here? I'm not very good at this apparently.

Pretty much a newbie here.

  • Would really appreciate any help.

5 Replies

are you running apache and mysql on the same server? If yes, have you adjusted Apache's MaxClients setting? If not, search this forum for "MaxClients", there are tons of threads on it. short version, apache's out-of-box settings are terrible.

There's quite a lot of things you'll want to keep a look out for.

Make sure you're not out of storage, run a df -h . If you're out of storage, your MySQL will crash almost immediately.

Check your RAM while the issue happens. free -m is enough to tell.

Check your logs. No matter what the issues is, checking your logs should explain that your server served this error and will show what happened right before it happened. Your logs are stored in /var/log for Debian systems.

Good luck!

Hey @tinman,

I'm having similar issues for no apparent reason.

If you're having space issues, regardless the distro you're using, maybe this can help you:

http://askubuntu.com/questions/266825/w … em-is-full">http://askubuntu.com/questions/266825/what-do-i-do-when-my-root-filesystem-is-full

Also, to the already suggested, I recommend you tune your Mysql/MariaDB database.

see here: https://www.linode.com/docs/databases/m … ne-mariadb">https://www.linode.com/docs/databases/mariadb/how-to-install-mariadb-on-centos-7#tune-mariadb

And the equivalent to Mysql tuner in Apache:

https://www.linode.com/docs/websites/ap … ache2buddy">https://www.linode.com/docs/websites/apache-tips-and-tricks/tuning-your-apache-server#apache2buddy

Although I haven't completely solved my question, It has improved a lot for me.

Best Regards

Thanks guys for the inputs that you've given. Really appreciate that.

I uninstalled MariaDB and installed MySQL, this has solved the issue. (Or it seems to have solved the issue atleast)

I want to make sure something like this doesn't pop up again (Would be really troublesome if it comes up after the app launches) any suggestions to make sure that the VPS is tuned up and optimized to its fullest capacity?

Thanks again guys!

This Virneto guy knows what's he's talking about, I'd say use those tuners (well, the ones that apply to your server). These should make sure your server is making the best use of its resources through proper tuning.

Good luck, Tinman!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct