Welcome! Log In Create A New Profile

Advanced

Request big JS file very slow if enable gzip on

October 26, 2014 11:04PM
Sorry about everyone, i posted in another forum but not got any response, really really hope can got your all help about the issue which already confuse me many days.

I installed nginx-1.6.2-1.el6.ngx.x86_64 with yum on CentOS 6.5 system. below are my settings:

nginx.conf
--------------------------------------------------------------------------------------------------------------
http {
error_log /var/log/nginx/error.log debug;

.............
#added
limit_conn_zone $binary_remote_addr zone=addr:10m;
gzip on;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

upstream szsmk_dev {
ip_hash;
server 172.17.3.22:28080;
server 172.17.3.22:28180;
}


server {
listen 172.17.3.22:80 default_server;

location /wx/js/ {
root /home/developer/jboss/server/citycard_dev/deploy/citycard.war/;
}
location /wx/css/ {
root /home/developer/jboss/server/citycard_dev/deploy/citycard.war/;
}



location / {
limit_conn addr 1000;
proxy_pass http://szsmk_dev;
}

}

}
--------------------------------------------------------------------------------------------------------------
for others settings all are default.

Test page: http://dev.szsmk.com/wx/ticket/index
Test browser: Chrome (disabled cache)

when i disabled gzip and everything runs well, but if set gzip as on, i got below 3 different results if refresh the page in chrome.

1. very slow to load (80%)
Most times the page will need more than 20 ~ 60 seconds to be loaded. I checked and found mostly were blocked by http://dev.szsmk.com/wx/js/libs/jquery-ui-1.10.3.min.js (222KB) and http://dev.szsmk.com/wx/js/libs/angular/angular.min.js (105KB). For all other files which little than 100kb load very fast.

error.log:
2014/10/26 20:44:30 [info] 20917#0: *80 client 49.73.183.141 closed keepalive connection
2014/10/26 20:44:30 [info] 20917#0: *83 client 49.73.183.141 closed keepalive connection
2014/10/26 20:44:30 [info] 20917#0: *82 client 49.73.183.141 closed keepalive connection
2014/10/26 20:44:30 [info] 20917#0: *85 client 49.73.183.141 closed keepalive connection

2. Response error: (10%)

for jquery-ui-1.10.3.min.js or angular.min.js, often got below error when request:

in browser shows: "(failed) net::ERR_EMPTY_RESPONSE"


in error.log shows:
2014/10/26 20:27:13 [info] 20917#0: *28 client prematurely closed connection (104: Connection reset by peer) while sending response to client, client: 49.73.183.141, server: , request: "GET /wx/js/libs/jquery-ui-1.10.3.min.js HTTP/1.1", host: "dev.szsmk.com", referrer: "http://dev.szsmk.com/wx/ticket/index"


3. load success(10%)
Sometimes i will can load the page success within 10 seconds

Anybody can tell me how to enable gzip and resolve the issue?
Subject Author Posted

Request big JS file very slow if enable gzip on

colky October 26, 2014 11:04PM

Re: Request big JS file very slow if enable gzip on

dewanggaba October 26, 2014 11:32PM

Re: Request big JS file very slow if enable gzip on

Valentin V. Bartenev October 26, 2014 11:46PM

Re: Request big JS file very slow if enable gzip on

dewanggaba October 26, 2014 11:54PM

Re: Request big JS file very slow if enable gzip on

Valentin V. Bartenev October 27, 2014 12:04AM

Re: Request big JS file very slow if enable gzip on

colky October 28, 2014 09:45PM

Re: Request big JS file very slow if enable gzip on

Valentin V. Bartenev October 29, 2014 02:10AM

Re: Request big JS file very slow if enable gzip on

colky October 27, 2014 12:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready