Forum: NGINX High traffic on Nginx-Webservers!

13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-04-22 11:40
(Received via mailing list)
Hello,

       We're using the cluster of 5 webservers using nginx (reverse
proxy)
+ apache to handle php requests. Our web-servers are constantly high
with
load-avg of 2.0~3.0. I have seen people using varnish between nginx +
apache. Could someone guide me if installing Nginx > Varnish > apache
will
reduce the server load ?

It's urgent.

Regards.
Shahzaib
41d49f737346c100d3fb863177997957?d=identicon&s=25 Rainer Duffner (Guest)
on 2014-04-22 12:17
(Received via mailing list)
Am Tue, 22 Apr 2014 14:39:53 +0500
schrieb shahzaib shahzaib <shahzaib.cb@gmail.com>:

> Hello,
>
>        We're using the cluster of 5 webservers using nginx (reverse
> proxy)
> + apache to handle php requests. Our web-servers are constantly high
> with load-avg of 2.0~3.0. I have seen people using varnish between
> nginx + apache. Could someone guide me if installing Nginx > Varnish
> > apache will reduce the server load ?
>
> It's urgent.


If the content is cachable, it will reduce load.

But deploying varnish requires some experience and knowledge of the
application.
Unless the application is e.g. plain-vanilla wordpress, there are no
out-of-the-box varnish tutorials to help you in your specific situation.

If your content is cachable and you don't require varnish's
cache-invalidation features, you could use nginx's proxy-caching
features.

See the wiki/handbook.
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-04-22 12:22
(Received via mailing list)
Thanks for quick response, well our website is related to video
streaming
just like youtube. Could you provide me some guide to learn varnish for
start-up ?

Any suggestions will be highly appreciated.

Shahzaib
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-04-22 12:25
(Received via mailing list)
>>If your content is cachable and you don't require varnish's
cache-invalidation features, you could use nginx's proxy-caching
features.

Well, i want to cache application means, dynamic php pages. Will that be
OK
with nginx ?
41d49f737346c100d3fb863177997957?d=identicon&s=25 Rainer Duffner (Guest)
on 2014-04-22 12:40
(Received via mailing list)
Am Tue, 22 Apr 2014 15:21:09 +0500
schrieb shahzaib shahzaib <shahzaib.cb@gmail.com>:

> Thanks for quick response, well our website is related to video
> streaming just like youtube. Could you provide me some guide to learn
> varnish for start-up ?
>
> Any suggestions will be highly appreciated.
>
> Shahzaib


Do you do the streaming from nginx or from php?


Documentation etc. is on https://www.varnish-cache.org/

For the improved handling of streaming, you will need the recently
released v4.0.
I don't know much about this, we don't do much varnish - and no
streaming.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 mex (Guest)
on 2014-04-22 12:40
(Received via mailing list)
if the content is cacheable, using varnish or nginx-cache will
definetely
reduce load.

we have a similar setup (nginx infront of apache+php) with an average of
5000 requests/second,
and using nginx-cache with a cache-time of 1 minute reduced load from
around
8 to
0.5 on the apache-servers, while the nginx-servers are still idleing at
around 0.2

we use to nginx to cache static content as well as dynamic pages






regards,


mex

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249437,249445#msg-249445
13731c628e20ffd83b6114ff2c406272?d=identicon&s=25 shahzaib mushtaq (shahzaib12)
on 2014-04-22 12:54
(Received via mailing list)
Mex, That's a high amount of reduction in load-avg than :). Could you
please refer me to some guide to start with nginx-cache ? And also it's
drawbacks if i put the wrong configs ?

As we're handling 18000 visitors concurrently on cluster of 5
webservers,
which makes it 3600 concurrent users per server by dividing it with the
5.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 mex (Guest)
on 2014-04-22 13:57
(Received via mailing list)
depending on your setup you might think about serving static
content and videos directly from nginx:
http://www.nginxtips.com/optimizing-nginx-for-video-sites/

anything served directly from nginx, not going to apache will boost your
performance.


> Mex, That's a high amount of reduction in load-avg than :). Could you
> please refer me to some guide to start with nginx-cache ?

http://nginx.org/en/docs/http/ngx_http_proxy_modul...
http://wiki.nginx.org/ReverseProxyCachingExample

a little more detailed:
http://reviewsignal.com/blog/2013/08/29/reverse-pr...





> And also it's
> drawbacks if i put the wrong configs ?

stale content, but it might be ok to run with a very short cache-time

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249437,249447#msg-249447
2974d09ac2541e892966b762aad84943?d=identicon&s=25 mex (Guest)
on 2014-04-22 14:05
(Received via mailing list)
D207dfc04524519f516e3f32df986d2e?d=identicon&s=25 Raul Hugo (Guest)
on 2014-04-22 16:41
(Received via mailing list)
Shahzaib, you have  a different server for the static content like the
videos? I'm talking about AWS cloudfront or something like that..



2014-04-22 7:05 GMT-05:00 mex <nginx-forum@nginx.us>:

> PONG
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,249437,249450#msg-249450
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



--
Un abrazo!


*Raúl Hugo <http://twitter.com/raulhugo>*


*Miembro Asociadohttp://apesol.org.pe <http://apesol.org.pe/>SysAdmin
Cel.
#961-710-096  Linux Registered User #482081 - http://counter.li.org/
<http://counter.li.org/>P Antes de imprimir este e-mail piense bien si
es
necesario hacerlo*
40b4c848b8fcd63b0cb60b9d170c3a77?d=identicon&s=25 Valentin V. Bartenev (Guest)
on 2014-04-22 17:59
(Received via mailing list)
On Tuesday 22 April 2014 15:53:27 shahzaib shahzaib wrote:
> Mex, That's a high amount of reduction in load-avg than :). Could you
> please refer me to some guide to start with nginx-cache ? And also it's
> drawbacks if i put the wrong configs ?
>

http://nginx.com/resources/admin-guide/caching

  wbr, Valentin V. Bartenev
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.