*** Add RAM before increasing MySQL buffer variables ***

Any recommendation about this message from mysqltuner? It hasn't been 24 hours since I last updated my.cnf but I have two Linodes here saying:

*** MySQL's maximum memory usage is dangerously high ***

*** Add RAM before increasing MySQL buffer variables ***

sortbuffersize (> 2M)

readrndbuffer_size (> 512K)

Feels like a fork in the road. What would you do?

1. Ignore the recommendation?

2. Figure out where to reduce the memory usage of mysql?

3. Increase these buffer variables despite the warning?

4. Upgrade?

6 Replies

It's telling you that the current configuration is not suitable for the available quantity of system RAM. You either need to add more RAM (== $) or use less RAM (== tradeoff).

Without seeing the full output, it's tough to advise where to go first, but usually lowering max_connections is a very good first choice for reducing maximum possible RAM usage.

@hoopycat:

It's telling you that the current configuration is not suitable for the available quantity of system RAM. You either need to add more RAM (== $) or use less RAM (== tradeoff).

Without seeing the full output, it's tough to advise where to go first, but usually lowering max_connections is a very good first choice for reducing maximum possible RAM usage.

Ooh, thanks for the advice. I see this line:

"[OK] Highest usage of available connections: 5% (9/151)"

I assume that's what I need to watch. Pretty cool!

151 max connections :shock: try setting max_connections = 20 in /etc/mysql/my.cnf and restart mysql.

Yes, default Fedora install with "yum" gave me 151 connections on both Linodes, not sure if that's specific to Fedora or not.

If I make max_connections real low (20 like obs said) and I end up with some extra ram, where would I get he most bang for my buck with my.cnf?

Now the top recommendations I get for both Linodes from mysqltuner:

sortbuffersize (> 4M)

readrndbuffer_size (> 2M)

Reading a few posts in Google, some people say sortbuffersize should be left default, I think it was at 512k. Sounds like every megabyte you add to sortbuffersize gets multiplied times max_connections, it adds up fast.

Anyway, that advice definitely made a difference, I feel much better about it now–no warning message through mysqltuner.

Maybe I'll post the entire mysqltuner report(s) here in a new thread after the traffic doubles and gets slow again ;-) I'm sure you're dying in anticipation.

@ferodynamics:

Yes, default Fedora install with "yum" gave me 151 connections on both Linodes, not sure if that's specific to Fedora or not.

the defaults in most distros assume tons of RAM. Check this library article for some pointers

http://library.linode.com/databases/mysql/fedora-14

It mainly depends on what tables you're using. If you're using innodb then you can ignore myisam specific features like key_buffer if you're using myisam you can ignore innodb like buffer bool.

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