Welcome! Log In Create A New Profile

Advanced

Re: Nginx VS Nginx + Varnish

Posted by Anonymous User 
Anonymous User
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:34PM
Dave Cheney wrote:
> From my experience, 60 small static files / second used 2% cpu on a
> OS X Xeon Server. Are you suspecting that your server is being limited
> in some way ?

Right now, I don't have problems.

I just want to optimize my web server for the best result (it takes
400-500ms to serve a 5kB image).


http://img29.picoodle.com/img/img29/3/10/10/f_monitoring0m_f2441cf.png

http://img33.picoodle.com/img/img33/3/10/10/f_monitoring0m_bb25457.png

Those images show my web site performance (from pingdom.com and
site-perf.com).

I'm wondering if there is something to reduce those timings...

Thanks.

Attachments:
http://www.ruby-forum.com/attachment/2797/monitoring00.png

--
Posted via http://www.ruby-forum.com/.
Anonymous User
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:34PM
Have you actually tried putting varnish/ncache in place and benchmarking
the before/after results? As I've found with all server set-ups: YMMV.

Gen Gennix wrote:
> Dave Cheney wrote:
>
>> From my experience, 60 small static files / second used 2% cpu on a
>> OS X Xeon Server. Are you suspecting that your server is being limited
>> in some way ?
>>
>
> Right now, I don't have problems.
>
> I just want to optimize my web server for the best result (it takes
> 400-500ms to serve a 5kB image).
>
>
> http://img29.picoodle.com/img/img29/3/10/10/f_monitoring0m_f2441cf.png
>
> http://img33.picoodle.com/img/img33/3/10/10/f_monitoring0m_bb25457.png
>
> Those images show my web site performance (from pingdom.com and
> site-perf.com).
>
> I'm wondering if there is something to reduce those timings...
>
> Thanks.
>
> Attachments:
> http://www.ruby-forum.com/attachment/2797/monitoring00.png
>
>

--

*Phillip B Oldham*
The Activity People
phill@theactivitypeople.co.uk <mailto:[email protected]>

------------------------------------------------------------------------

*Policies*

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.

------------------------------------------------------------------------
Anonymous User
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:34PM
I have tried both approaches. nginx on ZFS (arc caching) is superior in
performance to varnish in front of nginx. I can easily choke varnish
with many requests.

http://letsgetdugg.com/view/Nginx_hidden_performance_option

works very well for us in our production environment.

-Victor
--
Posted via http://www.ruby-forum.com/.
Anonymous User
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:34PM
oh yes I forgot, I have confronted one of the developers on #varnish
with my results. The said developer stated that nginx currently does
have the edge performance wise, even though they have the "superior"
architecture.

-Victor
--
Posted via http://www.ruby-forum.com/.
Igor Sysoev
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:40PM
On Fri, Oct 10, 2008 at 02:03:50PM +0200, Gen Gennix wrote:

> Dave Cheney wrote:
> > From my experience, 60 small static files / second used 2% cpu on a
> > OS X Xeon Server. Are you suspecting that your server is being limited
> > in some way ?
>
> Right now, I don't have problems.
>
> I just want to optimize my web server for the best result (it takes
> 400-500ms to serve a 5kB image).
>
>
> http://img29.picoodle.com/img/img29/3/10/10/f_monitoring0m_f2441cf.png
>
> http://img33.picoodle.com/img/img33/3/10/10/f_monitoring0m_bb25457.png
>
> Those images show my web site performance (from pingdom.com and
> site-perf.com).
>
> I'm wondering if there is something to reduce those timings...

What I see on these images is that TCP connection times are about
100ms-500ms. These values depend on client speed connection and kernel
internel processing only. User-level applications can not affect on it.
Thus, if you have 100-500ms TCP round trip, then small data chunks
will be processed in the same time, even if nginx will not block on disk
reads.

As to disk blocking, you have 30G images and 2G memory. nginx is probably
blocking on disk - see "wa" percents in top. You may try to increase
worker_processes to 10-20.

As to using varnish+nginx, I think varnish will not help in this case.


--
Igor Sysoev
http://sysoev.ru/en/
Gen Gennix
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:41PM
> Compression, gzip. You should try it, maybe for jpeg is not actually
> worth it... Hmm, try what can i say.

I already use static gzip on css and javascript file.
And for jpeg, it is not worth it, indeed.

Moreover, if you look at the monitoring image (in attachment), the loss
of time is while sending request and receiving http-headers from server
(25% of the total time).

I was wondering if we can reduce it?

PS: watch the last line of the image in attachment: it's the javascript
from Google Analytics, and the timing is really, really short!

--
Posted via http://www.ruby-forum.com/.
Robert Gabriel
Re: Nginx VS Nginx + Varnish
October 11, 2008 09:41PM
Compression, gzip. You should try it, maybe for jpeg is not actually
worth it... Hmm, try what can i say.
--
Posted via http://www.ruby-forum.com/.
Jeffrey 'jf' Lim
Re: Nginx VS Nginx + Varnish
October 12, 2008 11:50AM
On Sat, Oct 11, 2008 at 7:26 AM, Victor Iggy <[email protected]> wrote:
> I have tried both approaches. nginx on ZFS (arc caching) is superior in
> performance to varnish in front of nginx. I can easily choke varnish
> with many requests.
>
> http://letsgetdugg.com/view/Nginx_hidden_performance_option
>
> works very well for us in our production environment.
>
> -Victor
>
> --
> Posted via http://www.ruby-forum.com/.


On Sat, Oct 11, 2008 at 7:30 AM, Victor Iggy <[email protected]> wrote:
> oh yes I forgot, I have confronted one of the developers on #varnish
> with my results. The said developer stated that nginx currently does
> have the edge performance wise, even though they have the "superior"
> architecture.
>

and would this be on solaris only? or does it apply to other platforms as well?

-jf

--
In the meantime, here is your PSA:
"It's so hard to write a graphics driver that open-sourcing it would not help."
-- Andrew Fear, Software Product Manager, NVIDIA Corporation
http://kerneltrap.org/node/7228
Victor Iggy
Re: Nginx VS Nginx + Varnish
October 12, 2008 08:50PM
don't know, benchmark and find out. I have seen nginx edge out varnish
in performance on solaris and freebsd.

-Victor
--
Posted via http://www.ruby-forum.com/.
Praveen
Re: Nginx VS Nginx + Varnish
October 14, 2008 08:40PM
Serving thumbnails efficiently is not easy. See
http://highscalability.com/youtube-architecture (scroll down to
'Serving thumbnails').

You're spending a good chunk of time doing disk seeks. Even if read
time is 0, average seek time is about 10ms. So you're looking at a
limit of 100 images/sec. This is the ideal case. Add read time + TCP
delays + other delays, you're looking 50-60 images/sec.

Serve off memory, try using memcache.

-praveen

On Fri, Oct 10, 2008 at 5:03 AM, Gen Gennix <[email protected]> wrote:
> Dave Cheney wrote:
>> From my experience, 60 small static files / second used 2% cpu on a
>> OS X Xeon Server. Are you suspecting that your server is being limited
>> in some way ?
>
> Right now, I don't have problems.
>
> I just want to optimize my web server for the best result (it takes
> 400-500ms to serve a 5kB image).
>
>
> http://img29.picoodle.com/img/img29/3/10/10/f_monitoring0m_f2441cf.png
>
> http://img33.picoodle.com/img/img33/3/10/10/f_monitoring0m_bb25457.png
>
> Those images show my web site performance (from pingdom.com and
> site-perf.com).
>
> I'm wondering if there is something to reduce those timings...
>
> Thanks.
>
> Attachments:
> http://www.ruby-forum.com/attachment/2797/monitoring00.png
>
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
Praveen

Can you yell "Movie!" in a crowded firestation?

http://tigertrail.net
Victor Iggy
Re: Nginx VS Nginx + Varnish
October 14, 2008 09:00PM
umm, linux file cache? solaris ZFS ARC cache? who says you will be doing
disk seeks for frequently used files?

seems like varnish is clashing with what is already in place.

-Victor
--
Posted via http://www.ruby-forum.com/.
Praveen
Re: Nginx VS Nginx + Varnish
October 14, 2008 09:50PM
Yes. There is caching at the OS level too, which needs to be tuned
(like cache sizes, inode vs content etc). I did not look at your
benchmarks, but was commenting more on Gen's post. In the graphs he's
given, the latency between connect and sending first byte (the green
part) is high, which might explain disk seek/read.

-p

On Tue, Oct 14, 2008 at 11:36 AM, Victor Iggy <[email protected]> wrote:
> umm, linux file cache? solaris ZFS ARC cache? who says you will be doing
> disk seeks for frequently used files?
>
> seems like varnish is clashing with what is already in place.
>
> -Victor
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
Praveen

Can you yell "Movie!" in a crowded firestation?

http://tigertrail.net
Sorry, only registered users may post in this forum.

Click here to login