Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a JSF web application runs on Glassfish Application Server. I'm using Nginx with reverse proxing to Glassfish. I wanna see performance gains with Nginx, i'm testing application with JMeter. When i directly test the application on glassfish, there ise no error count. But, when i tested the application via Nginx response contains a lot of error count approx. %80. I changed some time out in nginx configuration file then no thing changed.

My Nginx Conf file;

#user  nobody;
worker_processes  3;
worker_rlimit_nofile 1024;
worker_priority -6;
#worker_cpu_affinity 01 10;

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

#pid        logs/nginx.pid;


events {
    multi_accept on;
    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 120m ;

    #gzip  on;

    #upstream glassfish {
      #  server 127.0.0.1:28080;
     #   server 127.0.0.1:28081;
   # }

    server {
        listen       8070;
        server_name  localhost;
        root "html";
        #charset utf-8;

        #access_log  logs/host.access.log  main;

        location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
        #autoindex on; 
        access_log off;
        expires max;        
        }

        location / {

        access_log off;

        proxy_pass http://localhost:8080/; >> to Glassfish port
        #proxy_pass http://localhost:43842/;
        #proxy_pass http://glassfish;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 120m;
        proxy_connect_timeout 120m;


        }



        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # 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;
    #    }
    #}

}

Whats the problem??

share|improve this question
    
Did you look in the nginx_error_log for hints? –  HTTP500 Jul 31 '12 at 15:25
    
Nginx refuses the connection –  Rahman Usta Jul 31 '12 at 15:49
    
Did you start jMeter with proxy params? –  mbonaci Jul 31 '12 at 20:43
    
What is the reason for using proxy?? i can reach to nginx by 127.0.0.1:8070. in for example 50 thread, nginx serves me normally, bu in more thred for example 1000, it gives me some response (connection refused) –  Rahman Usta Jul 31 '12 at 21:02
    
Either, when i test glassfish vs nginx, nginx slower than glassfish.. why?? –  Rahman Usta Jul 31 '12 at 21:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.