List:General Discussion« Previous MessageNext Message »
From:Rick James Date:April 9 2013 12:18am
Subject:RE: How to tweek the max connections
View as plain text  
There is no "exact" calculation.  Too many buffers, etc, are allocated (or not) on a
per-thread, or even per-subquery basis, that it is impractical to compute a totally
"safe" value for the various tunables.

Here's my discussion on such:
   http://mysql.rjweb.org/doc.php/memory
max_connections is a minor player in memory usage.

The STATUS value Max_used_connections gives the high-water-mark (since startup) toward
using up all of max_connections.

> -----Original Message-----
> From: spameden [mailto:spameden@stripped]
> Sent: Monday, April 08, 2013 4:32 AM
> To: Yu Watanabe
> Cc: mysql@stripped
> Subject: Re: How to tweek the max connections
> 
> Is it really so hard?
> 
> http://bit.ly/YG6JQn
> 
> first link shows how it works.
> 
> NOTE: it seems your MySQL setup might be using SWAP so be careful it
> can lead to slowdowns.
> 
> 
> 2013/4/8 Yu Watanabe <yu.watanabe@stripped>
> 
> > Hi all!
> >
> > I would like know if there are any calculatios for specifying the
> > maximum number of the 'max_connections' value.
> >
> > I understand that max_connections should be decided by the remaining
> > RAM size of the system. But exactly how should it be actually
> > calculated?
> >
> > I am currently using RHEL 5.3 32 bit and following are samples of the
> > memory usage of my system.
> >
> > [root@GWM bin]# ps -eo "pcpu,vsz,rss,args" | grep mysql
> >  0.0   5420  1172 /bin/sh /usr/bin/mysqld_safe --
> datadir=/var/lib/mysql
> > --pid-file=/var/lib/mysql/GWM.pid
> >  0.0 332592 40040 /usr/sbin/mysqld --basedir=/usr
> > --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin
> > --user=mysql --log-error=/var/lib/mysql/GWM.err
> > --pid-file=/var/lib/mysql/GWM.pid -- socket=/var/lib/mysql/mysql.sock
> --port=3306
> >  0.0   4980   760 grep mysql
> >
> > [root@GWM bin]# free
> >              total       used       free     shared    buffers
> cached
> > Mem:      16623956   12727012    3896944          0     103668
> 11634904
> > -/+ buffers/cache:     988440   15635516
> > Swap:     10482404       1368   10481036
> >
> > Version of mysql is ,
> >
> > [root@GWM bin]# mysqladmin -u root --password=groundwork variables |
> > grep version
> > | version                                           | 5.5.25-log
> >
> >                       |
> > | version_comment                                   | MySQL Community
> > Server (GPL)
> >                             |
> > | version_compile_machine                           | i686
> >
> >                       |
> > | version_compile_os                                | Linux
> >
> > Thanks,
> > Yu
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    http://lists.mysql.com/mysql
> >
> >
Thread
How to tweek the max connectionsYu Watanabe8 Apr
  • Re: How to tweek the max connectionsspameden8 Apr
    • RE: How to tweek the max connectionsRick James9 Apr
      • Re: How to tweek the max connectionsspameden9 Apr