Forum: NGINX Bad Performance when using two Nginx behind each other

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
maxigs (Guest)
on 2009-04-25 13:35
(Received via mailing list)
Hi,

i'm currently having pretty bad performance on my server setup which is
most likely just a little issue with my configuration but i cant figure
out what i do wrong. Google did not really help much either.

The Problem is pretty simple:

Its to slow, even static pages or assets (css files, images) are served
way to slow through my servers (a couple of seconds at most).

The Setup is:

Nginx 0.6.36 as frontend server (only to split the requests up to the
vhosts, since a couple of sites are going through the same ip)

Nginx or (still) some Apache servers behind which server the pages.

So when a request goes in, the first nginx proxy-passes it through to
the second servers which then deliver the sites (including all static
contents).

This setup seems to slow down performance dramatically, even simple
static files are delivered way to slow.

I already tried various configuration combinations (gzip/keep
alive/proxy options), but dont seem to get anywhere so far, it would be
great if someone had a basic idea to get me back on the track.

Thanks a lot !

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,1441,1441#msg-1441
Ryan Dahl (Guest)
on 2009-04-25 14:17
(Received via mailing list)
Why the double tiered setup? Use nginx to serve static content and
then proxy to backend processes (php-fcgi, mongrel or whatever). You
just need different upstreams.

e.g.

upstream site1_mongrels {
   #...
}

upstream site2_mongrels {
  # ...
}

server {
  listen site1.com
  #...
  proxy_pass site1_mongrels;
}

server {
  listen site2.com
  # ...
  proxy_pass site2_mongrels;
}
István (Guest)
on 2009-04-25 14:43
(Received via mailing list)
strace would be useful to see what is the nginx doing then, i am not
sure
btw. that this is nginx related at all. might be some trivial problem
with
apache like you anbled the dns resolution and forgot to setup the proper
resolv.conf and so on but without showing the exact configuration
including
the nginx frontend and the backends there is nothing much to say.

http://www.catb.org/~esr/faqs/smart-questions.html

regards,
Istvan
This topic is locked and can not be replied to.