Vadim Lazovskiy
February 27, 2016 11:58AM
27 февраля 2016 г., 19:07 пользователь Roman Arutyunyan <arut@nginx.com>
написал:

> Можете прислать всю конфигурацию?
>
>
# configuration file /etc/nginx/nginx.conf:
user nginx;
worker_processes 32;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

worker_rlimit_nofile 1048576;

#thread_pool pool_ssd01 threads=32;
#thread_pool pool_ssd02 threads=32;

events {
worker_connections 8196;
}

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

access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

include /etc/nginx/vhosts.d/*.conf;
}

# configuration file /etc/nginx/mime.types:

types {
....
}

# configuration file /etc/nginx/vhosts.d/<server_name>.conf:
map $upstream_hostname $allowed {
<host1> 1;
<host2> 1;

default 0;
}


log_format cache_video '$time_iso8601 $remote_addr "$request" $status
$bytes_sent $upstream_cache_status';

proxy_cache_path /disks/ssd01 levels=1:2 keys_zone=cache_ssd01:32m
use_temp_path=off inactive=7d max_size=210G;
proxy_cache_path /disks/ssd02 levels=1:2 keys_zone=cache_ssd02:32m
use_temp_path=off inactive=7d max_size=210G;

split_clients $request_uri $disk {
50% ssd01;
50% ssd02;
}


server {
listen <server_ip> default_server;

access_log /var/log/nginx/<server_name>-cache.log cache_video;
access_log /var/log/nginx/<server_name>-access.log;
error_log /var/log/nginx/<server_name>-error.log info;

root /var/www/vhosts/<server_name>;

resolver <resolver_ip>;

proxy_max_temp_file_size 0;

location /streams/ {
location ~
^/streams/(?<upstream_hostname>[^/]+)/(?<upstream_uri>.*)$ {
if ($allowed = 0) {
return 403;
}

#aio threads=pool_$disk;
#sendfile on;

slice 10m;

limit_rate 1M;
limit_rate_after 2M;

proxy_pass http://
$upstream_hostname/$upstream_uri$is_args$args;
proxy_set_header Host $upstream_hostname;
proxy_set_header Range $slice_range;

proxy_cache_min_uses 10;

proxy_cache cache_$disk;
proxy_cache_key
$upstream_hostname$upstream_uri$slice_range;
proxy_cache_revalidate on;

proxy_cache_bypass $arg_start;
proxy_no_cache $arg_start;

proxy_cache_lock on;

proxy_cache_use_stale error timeout invalid_header
updating http_500 http_502 http_503 http_504 http_403;
}
}
}


> Кроме того, можете проследить открытые дескрипторы у воркеров nginx и их
> изменение со временем? В особенности, растет ли их число и, если растет,
> то
> за счет чего именно.
>

Поставил

#!/bin/bash

DIR="/var/log/nginx-lsof"
STAMP=`date +"%Y%m%d%H%M"`

out_dir="$DIR/$STAMP"

[ ! -d "$out_dir" ] && mkdir -p "$out_dir"

/bin/ps wwho pid,args -C nginx-debug | cut -f 1,3 -d ' ' | while read pid
type
do
out_file="$out_dir/nginx-$type-$pid.log"
lsof -p "$pid" > $out_file
done

в крон раз в 5 минут. Посмотрим.
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 25, 2016 05:04AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 25, 2016 05:54AM

Re: slice module и proxy_cache_min_uses больше единицы.

Roman Arutyunyan February 25, 2016 08:54AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 25, 2016 10:46AM

Re: slice module и proxy_cache_min_uses больше единицы.

Evgeniy Berdnikov February 25, 2016 10:54AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 25, 2016 11:28AM

Re: slice module и proxy_cache_min_uses больше единицы.

Roman Arutyunyan February 25, 2016 01:30PM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 26, 2016 02:46AM

Re: slice module и proxy_cache_min_uses больше единицы.

Roman Arutyunyan February 26, 2016 04:54AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 27, 2016 10:50AM

Re: slice module и proxy_cache_min_uses больше единицы.

Roman Arutyunyan February 27, 2016 11:10AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 27, 2016 11:58AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vadim Lazovskiy February 29, 2016 01:24AM

Re: slice module и proxy_cache_min_uses больше единицы.

Roman Arutyunyan February 29, 2016 03:48AM

Re: slice module и proxy_cache_min_uses больше единицы.

Vasiliy P. Melnik February 29, 2016 04:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready