Nginx double requests for my upstreams?
Maxim Dounin
mdounin at mdounin.ru
Mon Jun 8 16:20:58 MSD 2009
Hello!
On Mon, Jun 08, 2009 at 06:45:03AM -0400, funkdoobiest wrote:
> Hello,
>
> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Hello!
> >
> > On Sun, Jun 07, 2009 at 03:35:41PM -0400,
> > funkdoobiest wrote:
> >
> > > Hi Maxim,
> > >
> > > Maxim Dounin Wrote:
> > >
> > --------------------------------------------------
> > -----
> > > > Hello!
> > > >
> > > > On Fri, Jun 05, 2009 at 07:59:13AM -0400,
> > > > funkdoobiest wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I have a strange behavior for my site load
> > > > balanced with nginx.
> > > > > I have 1 Loadbalancer with nginx and 3
> > servers
> > > > with apache.
> > > > >
> > > > > sometimes a request is doubled and send to
> > 2 of
> > > > my apache webservers.
> > > > > this is a big problem for me, because this
> > is
> > > > sometimes a requests that is doing a
> > payement.
> > > > > I checked this behavior with doing a log of
> > all
> > > > my payment transactions and there a some
> > > > transactions
> > > > > for the same person double at the same
> > second!
> > > > (the user can't do this at the website,
> > because I
> > > > send the form which is doing the request with
> > JS
> > > > and ask the User if he really wants to pay and
> > so
> > > > on)
> > > >
> > > >
> > http://wiki.nginx.org/NginxHttpProxyModule#proxy_n
> >
> > > > ext_upstream
> > > >
> > > > Maxim Dounin
> > >
> > > Thank you for your help. I set
> > proxy_next_upstream to off, but there are still
> > double requests :-(
> >
> > It doesn't looks like nginx problem. Try checking
> > logs (frontend
> > and backend ones) - probably your javascript code
> > just does
> > something wrong.
> >
> > Maxim Dounin
>
> I checked it about 100 times. I checked the logs also. It's not my script.
> The requests are at the same second. If i disable the loadbalancer (in this case nginx) double request are stopping.
Try the following:
1. Post here nginx -V output to make it clear which version do you
use.
2. Post here results of your logs investigations to make it clear
that problem appears somewhere at nginx level.
This should include relevant nginx access logs (expected: one line
with client request; and some grep results to show there is no other
identical lines), relevant backend access logs (doubled request
should be visible here), relevant lines from nginx error_log if any.
3. Post here your nginx configs to make it clear how requests in
question are processed. There are more than one way to screw
things up, and nginx config does matter.
4. Try obtaining relevant debug log (some info may be found at
http://wiki.nginx.org/NginxDebugging), post it here.
Maxim Dounin
More information about the nginx
mailing list