6

I have a server that is running mysql and it's using a lot of memory. I run:

mysql > show status like '%onn%'; +--------------------------+-------+ | Variable_name | Value | +--------------------------+-------+ | Aborted_connects | 4 | | Connections | 98609 | | Max_used_connections | 20 | | Ssl_client_connects | 0 | | Ssl_connect_renegotiates | 0 | | Ssl_finished_connects | 0 | | Threads_connected | 1 | +--------------------------+-------+ 

But then if I run 'show processlist' as the root user I don't see anything. I've tried google for this but It always comes up with stuff related to connection errors. Could someone please just explain why I can't see the connections and how to actually go in and see them?

5
  • 3
    Connections is total number of connections since the server started, not the current number of connections. Commented Nov 3, 2014 at 18:36
  • Well that explains one thing, but it still stands that the server is using huge amounts of RAM with no appearance of anything happening? I have to manually reboot the MySQL server to clear it all our but I don't think that's a very good way of solving the problem. Commented Nov 3, 2014 at 18:45
  • 1
    This doesn't help you, but my MySQL does the same thing. stackoverflow.com/questions/1178736/mysql-maximum-memory-usage and serverfault.com/questions/415530/… may or may not also help. Once MySQL requests memory, it never gives it back (many Unix apps are like that), so your max memory usage = your current memory usage. Commented Nov 3, 2014 at 18:57
  • Awesome those links are very informative! Thankyou! Commented Nov 3, 2014 at 19:00
  • MySQL keeps lots of stuff, like database indexes, cached in memory. Commented Nov 4, 2014 at 22:24

2 Answers 2

1

The connection parameter is a bit of a misnomer. It indicates the number of connections that have been made to the server since the server started. The one you might be interested in is Threads connected.

0

You have to use ip_conntrack netfilter module, Then you can manipulate maximum connections. You have to change value of net.ipv4.netfilter.ip_conntrack_max via sysctl

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.