How to reduce the latency overheads of Nginx as load balancer


I am using Nginx as my load balancer to Apache backend servers. It works

But I experienced a significant latency overhead Nginx load balancer
added under heavy loaded traffics. I noticed that the response time
increased from 1.5 sec to 3.0 sec, when compared with the case that no
Nginx is used.

Do you have any suggestions on how I should configure Nginx to reduce
such latency overheads?
My Nginx configuration is attached below for your info.


My Nginx configuration file

worker_rlimit_nofile 65536;
worker_processes 4;

events {
worker_connections 8182;
use epoll;
http {
server_names_hash_bucket_size 64;
include /usr/local/nginx/conf/mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
tcp_nodelay on;
fastcgi_read_timeout 180;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
upstream backend_10_1{
server; server; server;

server {
    server_name default;
    error_log /dev/null crit;
    access_log off;
    rewrite_log off;
    location / {
        proxy_pass         http://backend_10_1;
        proxy_redirect     off;
        proxy_buffering    off;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For


Posted at Nginx Forum: