0

I am currently using nginx to serve downloads off my website. Users sometimes need to wait about 5 seconds before their download starts after clicking a download link. I'm not sure if I need to start using raid 10 (I'm currently using raid 50) or if this is a problem with my nginx configuration. I am also on a 1gbit line but download sometimes go as low as 10kB/s. My server: Dual Xeon 5620 CPU, 12x2TB drives with 8GB ram.

This is my nginx.conf

#user  nobody;
worker_processes  12;
worker_rlimit_nofile 10240;
worker_rlimit_sigpending 32768;

error_log  logs/error.log  crit;

#pid        logs/nginx.pid;


events {
    worker_connections  2048;
}


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

    access_log  off;
    limit_conn_log_level info;
    log_format  xfs  '$arg_id|$arg_usr|$remote_addr|$body_bytes_sent|$status';

    #sendfile       on;
    #tcp_nopush     on;
    reset_timedout_connection on;

    server_tokens off;
    autoindex off;

    keepalive_timeout  0;
    #keepalive_timeout  65;

    limit_zone one $binary_remote_addr 10m;
    perl_modules  perl;
    perl_require  download.pm;

This is my iostat

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           6.05    6.49    1.22   23.33    0.00   62.91

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               1.30    31.80  257.10   11.70 47852.80  1449.90   183.42    82.50  311.28   3.72 100.00
dm-0              0.00     0.00    0.00    1.10     0.00     8.80     8.00     0.21  169.64 124.45  13.69
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-2              0.00     0.00  251.90   41.30 46423.20  1435.50   163.23   101.98  348.08   3.31  96.96

iotop

enter image description here

3
  • You're not using sendfile and you appear not to have configured your buffers at all. I'd honestly just turn sendfile on if I were you. Nov 16, 2011 at 5:59
  • Can you explain what benefits sendfile and buffers provides? Nov 16, 2011 at 6:55
  • I turned on sendfile. I will see if it does anything Nov 16, 2011 at 7:24

1 Answer 1

1

What does your monitoring show? Are you close to maxing out your connection? Are you seeing high load? Large numbers of concurrent connections? What's your IOStat look like?

Without monitoring, it's impossible for us to give you any sort of decent information. Your delays could be caused by something like a bad DNS resolver, or your HDD's being maxed out.

1
  • It's high io load. I've added my iostat results Nov 16, 2011 at 3:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .