2013/4/3 Rick James <rja...@yahoo-inc.com>

> SELECT is not performed in the same thread as nginx; it is performed in
> another process, or even (in big web setups) in a different host.
>  Therefore, nginx would be in some form of "wait" state, thereby not really
> using the CPU.
>

ofc select is not performed in nginx thread, nginx acts as a proxying
server and just passes the request to the backend

it's entirely depends on your backend how fast it's gonna process certain
SELECT and ofc depends on what kind of database you've got

if backend takes too long to respond nginx just shows 502 error with
timeout from backend (by default: 30s).

good practice is to have multiple backends behind load balancer, so under
huge load no single request would be lost.


>
> > -----Original Message-----
> > From: Reindl Harald [mailto:h.rei...@thelounge.net]
> > Sent: Tuesday, April 02, 2013 2:00 PM
> > To: mysql@lists.mysql.com
> > Subject: Re: How to change max simultaneous connection parameter in
> > mysql.
> >
> >
> >
> > Am 02.04.2013 22:56, schrieb Rick James:
> > > I hear that nginx is very fast for a certain class of web serving.
> >
> > yes
> >
> > > But what happens if a web page needs to do a SELECT?
> >
> > what should happen?
> >
> > > Is nginx single-threaded, thereby sitting "idle" waiting for the
> > SELECT?
>

nginx is multi threaded and it supports SMP architecture, there is main
process which controls everything and nginx configuration can be reloaded
with zero downtime.

I saw multiple test where under load (simple DDoS simulation attack like
there where 40k bots hitting the site at once) nginx+php5-fpm dropped much
less requests than apache2 + mod_php.

apache2 is so bad at eating memory and system resources.


> >
> > why should it do that?
> >
> > > And, should you run 8 nginx web servers on an 8-core box?
>

no, you just tune

worker_processes 8;

>
> > why should you do that?
> >
> > http://en.wikipedia.org/wiki/Nginx
> > nginx uses an asynchronous event-driven approach to handling requests
> >
> > >> -----Original Message-----
> > >> From: spameden [mailto:spame...@gmail.com]
> > >> Sent: Tuesday, April 02, 2013 7:10 AM
> > >> To: Reindl Harald
> > >> Cc: mysql@lists.mysql.com
> > >> Subject: Re: How to change max simultaneous connection parameter in
> > >> mysql.
> > >>
> > >> 2013/3/24 Reindl Harald <h.rei...@thelounge.net>
> > >>
> > >>>
> > >>>
> > >>> Am 24.03.2013 05:20, schrieb spameden:
> > >>>> 2013/3/19 Rick James <rja...@yahoo-inc.com>:
> > >>>>>> 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.
> > >>
> > >>
> > >>>
> > >>>>> 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?
> > >>
> > >>
> > >>>
> > >>>> The best combo is php5-fpm+nginx.
> > >>>> Handles loads of users at once if well tuned
> > >>>
> > >>> Apache 2.4 handles the load of 600 parallel executed php-scripts
> > >>> from our own CMS-system
> > >>>
> > >>
> > >> Nginx serves static content way better than apache2 (did few
> > >> benchmarks already).
> > >>
> > >> nginx+php5-fpm handles better load than apache2-prefork+mod_php
> > >>
> > >> you can google benchmarks if you dont trust me
> > >>
> > >> also nginx eats much less memory than apache2
> > >>
> > >> php5-fpm can be tuned as well to suit your needs if you have lots of
> > >> dynamic content
> > >>
> > >>
> > >>> maybe you guys should learn what a opcode-cache is and how to
> > >>> compile and optimize software (binaries and config)
> > >>>
> > >>> o'rly?
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>
>

Reply via email to