ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Медленная отдача при виде остриминге


  • To: nginx-ru@xxxxxxxxx
  • Subject: Медленная отдача при виде остриминге
  • From: "kyxap" <nginx-forum@xxxxxxxx>
  • Date: Fri, 26 Mar 2010 10:40:25 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To:Date; bh=9QEoW9Ett0acMgPlH/gk9GKSl1j7OuAkE/WlWQqYKp4=; b=M2EQO6KRCEQ6oErkgC7l4ZV/2GdUw1YdKkKAe6TAn8Q1MK38xDNTpTU1wIZc8RUj/cEA8TZJo9ZtZ4/5OyQK84b9Vhj3Y/TZkiIR2j76v28fGEdkara1BlQnCZh/cVZp;

FreeBSD 7.2 i386, dual xeon X3230, 4Gb, 2x500Gb SATA2 7200rpm с отключенным 
AHCI в gmirror round-robin, опции newfs стандартные.
Немного php-скриптов на апаче, через H264 Streaming Module 2 стримится видео.
Размер mp4/flv файлов от 200 до 400 мегабайт и совсем чуть-чуть html-файлов.
К сожалению, не могу добиться скорости отдачи больше150 мегабит - винты 
загибаются, что мне кажется странным.
Включил поддержку AIO, это добавило порядка 20 мегабит, но все равно к  
желаемому результату 250+ мегабит не привело.
Что-то не так с настройками nginx? И сможет ли помочь добавление в массив еще 
1-2х дисков или замена этих двух дисков на Raptor'ы? 

gstat
dT: 1.001s  w: 1.000s
 L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
    0      0      0      0    0.0      0      0    0.0    0.0  acd0
   11     82     82   9247  110.2      0      0    0.0  100.3  ad4
    0      0      0      0    0.0      0      0    0.0    0.0  ad4s1
   12     89     89   9906  157.1      0      0    0.0  101.1  ad6
   23    171    171  19153  134.7      0      0    0.0  100.3  mirror/gm0
    0      0      0      0    0.0      0      0    0.0    0.0  ad6s1
   23    171    171  19153  134.7      0      0    0.0  100.3  mirror/gm0s1
    0      0      0      0    0.0      0      0    0.0    0.0  mirror/gm0s1a
    0      0      0      0    0.0      0      0    0.0    0.0  mirror/gm0s1b
    0      0      0      0    0.0      0      0    0.0    0.0  mirror/gm0s1c
    0      0      0      0    0.0      0      0    0.0    0.0  mirror/gm0s1d
    0      0      0      0    0.0      0      0    0.0    0.0  mirror/gm0s1e
   23    171    171  19153  134.7      0      0    0.0  100.3  mirror/gm0s1f

 top
last pid: 21185;  load averages:  0.16,  0.23,  0.18  up 3+14:09:45    03:09:50
73 processes:  1 running, 72 sleeping
Mem: 2195M Active, 869M Inact, 269M Wired, 137M Cache, 112M Buf, 36M Free
Swap: 2048M Total, 244K Used, 2048M Free
  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU COMMAND
18471 www         1  -8    0  1070M  1016M biord  1   1:25  3.56% nginx
18470 www         1  -4    0  1176M  1106M ufs    2   1:22  2.29% nginx

netstat -m
7515/7470/14985 mbufs in use (current/cache/total)
1374/1772/3146/65536 mbuf clusters in use (current/cache/total/max)
1374/1186 mbuf+clusters out of packet secondary zone in use (current/cache)
5858/5980/11838/12800 4k (page size) jumbo clusters in use 
(current/cache/total/max)
0/0/0/6400 9k jumbo clusters in use (current/cache/total/max)
0/0/0/3200 16k jumbo clusters in use (current/cache/total/max)
28058K/29331K/57390K bytes allocated to network (current/cache/total)
0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
0/0/0 requests for jumbo clusters denied (4k/9k/16k)
82/8074/32768 sfbufs in use (current/peak/max)
0 requests for sfbufs denied
0 requests for sfbufs delayed

stub
Active connections: 680 
server accepts handled requests
 6749 6749 18797 
Reading: 0 Writing: 643 Waiting: 37

nginx.conf

worker_processes 2;

events {
  worker_connections 4096;
  use kqueue;
}

http {
  server_names_hash_bucket_size 128;
  include mime.types;
  default_type application/octet-stream;
  access_log off;
  server_tokens off;
  sendfile off;
  aio on;
  directio 2m;
  output_buffers 1 2m;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 15;
  connection_pool_size 2k;
  request_pool_size 4k;
  gzip on;
  gzip_proxied     any;
  gzip_comp_level 9;
  gzip_types text/plain text/css application/json application/x-javascript 
text/xml application/xml application/xml+rss text/javascript;
  server {
    listen 11.22.33.44:80;
    server_name site.com www.site.com;
    root /home/user/site.com;
    index index.html index.htm;
    access_log off;

    location / {
      proxy_pass         http://127.0.0.1:80;
      proxy_redirect     default;
      proxy_set_header   Host             $host;
      proxy_set_header   X-Real-IP        $remote_addr;
      client_max_body_size       50m;
      client_body_buffer_size    128k;
      reset_timedout_connection  on;
      proxy_buffering            off;
      proxy_connect_timeout      90;
      proxy_send_timeout         90;
      proxy_read_timeout         90;
      proxy_buffer_size   4k;
      proxy_buffers              4 32k;
      proxy_busy_buffers_size    64k;
      proxy_temp_file_write_size 64k;
      charset         off;
    }
                      
    location ~ \.flv$ {
        flv;
        root /home/user/site.com;
    }
                      
    location ~ \.mp4$ {
        mp4;
        root /home/user/site.com;
    }
    
    location ~* ^.+\.(gif|jpg|jpeg|png|ico|bmp|mpg|mp3|mpeg|avi|wmv|js|css)$ {
      root /home/user/site.com;
    }
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,68014,68014#msg-68014


_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.