Welcome! Log In Create A New Profile

Advanced

nginx extremelly slow

Posted by rage77 
nginx extremelly slow
December 13, 2013 03:10PM
Hi, i've just finished set up a new nginx instalation on windows 7 it just proxy a node.js express application and a node.js service, the problem is that after finishing the configuration, the site is unusable, is really slow and i'm sure there is something missing but i can not figure out what. Any ideas???

I'm also seeing a lot of this lines in my errors log file

2013/12/13 16:26:46 [error] 356#7660: *1 upstream timed out (10060: FormatMessage() error:(15100)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /css/bootstrap.min.css HTTP/1.1", upstream: "http://[::1]:8000/css/bootstrap.min.css", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:26:46 [error] 356#7660: *3 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /css/login.css HTTP/1.1", upstream: "http://[::1]:8000/css/login.css", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:26:46 [error] 356#7660: *5 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /css/user-profile.css HTTP/1.1", upstream: "http://[::1]:8000/css/user-profile.css", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:26:46 [error] 356#7660: *2 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /css/media-queries.css HTTP/1.1", upstream: "http://[::1]:8000/css/media-queries.css", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:26:46 [error] 356#7660: *7 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /scripts/vendor/jquery/jquery.js HTTP/1.1", upstream: "http://[::1]:8000/scripts/vendor/jquery/jquery.js", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:26:46 [error] 356#7660: *4 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /scripts/vendor/backbone/backbone.js HTTP/1.1", upstream: "http://[::1]:8000/scripts/vendor/backbone/backbone.js", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:29:52 [error] 356#7660: *67 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "POST /actors/login HTTP/1.1", upstream: "http://[::1]:8001/actors/login", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:30:53 [error] 356#7660: *67 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /public/images/bkg-rpt-wave.png HTTP/1.1", upstream: "http://[::1]:8000/public/images/bkg-rpt-wave.png", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:31:58 [error] 356#7660: *67 upstream timed out (10060: FormatMessage() error:(15105)) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /jobs/saved/actor/?actorId=526eb8eeec0629fc1b000007 HTTP/1.1", upstream: "http://[::1]:8001/jobs/saved/actor/?actorId=526eb8eeec0629fc1b000007", host: "localhost:4000", referrer: "http://localhost:4000/"
2013/12/13 16:41:25 [notice] 6192#5364: signal process started

Here is my configuration

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

upstream engine {
server localhost:8001;
keepalive 64;
}

upstream marionette {
server localhost:8000;
keepalive 64;
}



server {
listen 4000;
server_name localhost;
access_log C:/development/nginx-1.4.4/logs/nodetest.log;


location / {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://marionette;
proxy_redirect off;

}

location ~*/industries {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /actors {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location verify {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /assessments {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /actor_assessments {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /enrollments {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}



location /create_customer {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /jobs {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /predictoccupation {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /cpreferences {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /occupations {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}

location /courses {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://engine;
proxy_redirect off;
}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}


# HTTPS server
#
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}
Re: nginx extremelly slow
December 13, 2013 05:03PM
"upstream timed out"

As it says, the upstream servers are not working, this needs to be fixed first.
Re: nginx extremelly slow
December 13, 2013 05:10PM
mmm, what do you mean with not working? they are working, the page eventually loads, and if i remove nginx the site and service works perfectly
Re: nginx extremelly slow
January 06, 2014 10:10AM
Hi rage77,

I am having excatly the same issue. did you find a solution?

thanks.

my config is as below:


worker_processes 10;

events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;


sendfile on;
tcp_nopush on;

keepalive_timeout 0;

upstream backend {
server localhost:8080;
}

server {
listen 80;
server_name *.netmera-dev.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://backend;
proxy_read_timeout 5;
}
}

}
Re: nginx extremelly slow
January 30, 2014 09:06AM
Hi everyone, I'm Cruz,

This seems the same problem I´m running into. Only happens on windows, it´s also reported on this thread http://forum.nginx.org/read.php?15,239760,239760

Looks like my requests are taking 1 minute to execute (and no processing is done as nginx is just calling a closed socket maybe?)

A bug should be reported on nginx for Windows
Re: nginx extremelly slow
February 04, 2014 10:25AM
Hi all,

This is not an error, but a misconfiguration. The problem is caused because localhost can be resolved as an ipv6 address (::1) and an ipv4 address (127.0.0.1) and the backend is not listening on both interfaces.

Thanks a lot to Maxim Dounin for the troubleshooting.

Please read on http://trac.nginx.org/nginx/ticket/496#ticket
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 168
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready