April 25, 2015 02:01PM
Hey guys,

I have a dedicated server at iWeb.com (i3-540 + 8GB RAM). It has free bandwidth, average load is around 0.05-0.2 during the day and I/O wait ratio is very low now.

However, sometimes my Nginx 1.4.2 loads in a browser 1MB image for like 10-30 seconds. Sometimes it takes 2 seconds like it should. My bandwidth is also free, of course. I made some tests like MTR, ping, traceroute -- everything is OK.

Updated Nginx to 1.8.0 but nothing's changed.

Here is my Nginx config:
==============================================================
worker_processes 4;
worker_rlimit_nofile 12400;

events {
worker_connections 32768;
}

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"';

sendfile on;
tcp_nopush on;
tcp_nodelay on;

gzip on;
gzip_min_length 1400;
gzip_proxied any;
gzip_types text/plain text/xml application/xml application/x-javascript text/javascript text/css text/json;
gzip_comp_level 6;

map $http_host $root_dir {
hostnames;
}
root $root_dir;

server {
listen 188.88.88.88:80;
server_name domain.com www.domain.com;
access_log /nginx/logs/domain.com-access.log main;

location / {
proxy_pass http://domain.com:8080/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

client_max_body_size 20m;
client_body_buffer_size 128k;

proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;

root /home/www/domain.com;
}
}
}
==============================================================

I use server for a couple of websites (PHP+MySQL). One of websites is an image hosting. Usually it serves images less than 1Mb but I created a couple of tools so user can upload a bigger image now. But still 3-5Mb max.

Does anybody know what causes this loading lag?

Thanks in advance!
Subject Author Posted

Static files bad loading time

grigory April 25, 2015 02:01PM

Re: Static files bad loading time

grigory April 25, 2015 02:05PM

Re: Static files bad loading time

Francis Daly April 25, 2015 06:40PM

Re: Static files bad loading time

grigory April 26, 2015 06:11AM

Re: Static files bad loading time

grigory April 27, 2015 11:59AM

Re: Static files bad loading time

Francis Daly April 30, 2015 01:16PM

Re: Static files bad loading time

grigory May 07, 2015 01:56PM

Re: Static files bad loading time

shahzaib1232 May 07, 2015 02:30PM

Re: Static files bad loading time

Valentin V. Bartenev May 08, 2015 07:44AM

Re: Static files bad loading time

shahzaib1232 May 08, 2015 09:08AM

Re: Static files bad loading time

Valentin V. Bartenev May 08, 2015 09:20AM

Re: Static files bad loading time

shahzaib1232 May 08, 2015 10:46AM

Re: Static files bad loading time

Francis Daly May 27, 2015 05:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 289
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready