List:General Discussion« Previous MessageNext Message »
From:Rick James Date:April 2 2013 9:14pm
Subject:RE: How to change max simultaneous connection parameter in mysql.
View as plain text  
(Thanks for the comment, spameden.)
Well, I was going to drop the thread, but he baited me.  I _do_ know something about web
serving...

Should I recount the number of times I have traced a database meltdown back to MaxClients
being too big?  They are _ugly_ meltdowns -- hundreds of point-queries stumbling over
themselves, flooding the slowlog with queries that should never take more than
milliseconds.  More and more db requests come in, non finishing, thereby stalling the web
server threads, etc.

Another point to make -- once a web server (Apache or...) has saturated the CPU (or other
shared resource), there is really no advantage, only disadvantage, in starting more web
pages.  The will simply contend for the saturated resource, thereby slowing down _all_
threads.  It is better (at this point) to queue up (or drop) further requests, thereby
giving the CPU a chance to actually finish something.

Yet another point...  If
   [ SUM(MaxClients) over the web servers you have ] >
   [ SUM(max_connections) over the Slaves ],
then you are threatening to have mysql refuse connections; this probably leads to broken
web pages, maybe even 404s or 500s.  Granted, you have (at least) 3 choices: decrease
MaxClients, increase max_connections, or add more Slaves.  If mysql has most of
max_connections _actively_ running querieds, then it is probably stumbling badly, so I
vote against increasing that.  Adding a Slave cannot be done 'instantly'.  That leaves
decreasing MaxClients, which is quick and easy.  Furthermore, the SE (in one of the
meltdowns) killed Apache; this led to a prompt clear up of all the issues -- poor web
response, mysql melting down, etc.

Sometimes less is better!

> -----Original Message-----
> From: Reindl Harald [mailto:h.reindl@stripped]
> Sent: Tuesday, April 02, 2013 8:29 AM
> To: mysql@stripped
> Subject: Re: How to change max simultaneous connection parameter in
> mysql.
> 
> 
> 
> Am 02.04.2013 16:09, schrieb spameden:
> > 2013/3/24 Reindl Harald <h.reindl@stripped
> > <mailto:h.reindl@stripped>>
> >
> >     Am 24.03.2013 05:20, schrieb spameden:
> >     > 2013/3/19 Rick James <rjames@stripped
> <mailto:rjames@stripped>>:
> >     >>> you never have hosted a large site
> >     >> Check my email address before saying that.
> >     >
> >     > :D
> >
> >     as said, big company does not have only geniusses
> >
> > I do not judge only on 1 parameter, Rick has been constantly helping
> > here and I'm pretty sure he has more knowledge on MySQL than you.
> 
> but the MySQL knowledge alone is not enough in context of a webserver
> not to say irrelevant
> 
> >     >> 20 may be low, but 100 is rather high.
> >     > Never use apache2 it has so many problems under load..
> >
> >     if you are too supid to configure it yes
> >
> > Ever heard about Slow HTTP DoS attack?
> 
> my config says yes as i heard about many things because it is my daily
> job
> 
>     0     0 LOG        tcp  --  eth0   *      !<local-network>/24
> 0.0.0.0/0            multiport dports
> 80,443 tcpflags: 0x17/0x02 #conn src/32 > 50 limit: avg 100/hour burst
> 5 LOG flags 0 level 7 prefix "Firewall
> Slowloris: "
>     0     0 DROP       tcp  --  eth0   *      !<local-network>/24
> 0.0.0.0/0            multiport dports
> 80,443 tcpflags: 0x17/0x02 #conn src/32 > 50

Thread
How to change max simultaneous connection parameter in mysql.Kevin Peterson16 Mar
  • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald16 Mar
  • Re: How to change max simultaneous connection parameter in mysql.Manuel Arostegui16 Mar
    • Re: How to change max simultaneous connection parameter in mysql.Igor Shevtsov16 Mar
      • RE: How to change max simultaneous connection parameter in mysql.Rick James18 Mar
        • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald18 Mar
          • RE: How to change max simultaneous connection parameter in mysql.Rick James18 Mar
            • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald18 Mar
              • Re: How to change max simultaneous connection parameter in mysql.Noel Butler18 Mar
              • RE: How to change max simultaneous connection parameter in mysql.Rick James19 Mar
                • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald19 Mar
                • Re: How to change max simultaneous connection parameter in mysql.spameden24 Mar
                  • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald24 Mar
                    • Re: How to change max simultaneous connection parameter in mysql.Manuel Arostegui24 Mar
                    • Re: How to change max simultaneous connection parameter in mysql.spameden2 Apr
                      • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald2 Apr
                        • RE: How to change max simultaneous connection parameter in mysql.Rick James2 Apr
                          • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald2 Apr
                      • RE: How to change max simultaneous connection parameter in mysql.Rick James2 Apr
                        • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald2 Apr
                          • RE: How to change max simultaneous connection parameter in mysql.Rick James2 Apr
                            • Re: How to change max simultaneous connection parameter in mysql.Reindl Harald2 Apr
                            • Re: How to change max simultaneous connection parameter in mysql.spameden2 Apr