<div dir="ltr">Здравствуйте.<div><br></div><div>Возникает проблема с отдачей данных из кэша при использовании связки slice module + aio treads.</div><div><br></div><div>Проблема 1 (aio выключено, slice включен):</div><div>Если запустить скачивание файла через прокси, прервать на середине, а потом запустить заново, закешированная часть отдается медленно (5-8 мегабайт/сек). Ежели докачать файл через прокси до конца, последующие запросы к нему происходят на максимальной скорости (1Gbps в тесте).</div><div><br></div><div>С чем может быть связана медленная отдача закешированных слайсов?</div><div><br></div><div>Проблема 2 (aio включено slice включен):</div><div>Если запустить  скачивание файла через прокси, скорость очень низкая, соединение постоянно разрывается. В логах при этом:</div><div><div>2016/02/23 10:36:11 [alert] 11124#11124: task #1 already active</div><div>2016/02/23 10:36:12 [alert] 11124#11124: task #4 already active</div><div>2016/02/23 10:36:14 [alert] 11124#11124: task #7 already active</div><div>2016/02/23 10:36:17 [alert] 11124#11124: task #10 already active</div><div>2016/02/23 10:37:59 [alert] 11124#11124: task #23 already active</div><div>2016/02/23 10:38:07 [alert] 11124#11124: task #35 already active</div><div>2016/02/23 10:38:17 [alert] 11124#11124: task #37 already active</div></div><div><br></div><div>Если отключить slice module, все становится хорошо.</div><div><br></div><div>С чем могут быть связаны данные проблемы?</div><div><br></div><div>Спасибо.</div><div><br></div><div><br></div><div>Конфиг:</div><div><br></div><div>thread_pool pool_ssd01 threads=16;<br></div><div><br></div><div><div>proxy_cache_path /disks/ssd01 levels=1:2 keys_zone=cache_ssd01:4m use_temp_path=off inactive=7d max_size=230G;</div><div><br></div><div>split_clients $request_uri $disk {</div><div>        100% ssd01;</div><div>}</div><div><br></div><div><div>        location /streams/ {</div><div>                location ~ ^/streams/(?<upstream_hostname>[^/]+)/(?<upstream_uri>.*)$ {</div><div>                        if ($allowed = 0) {</div><div>                                return 403;</div><div>                        }</div><div><br></div><div>                        slice 10m;</div><div><br></div><div>                        aio threads=pool_$disk;</div><div><br></div><div>                        proxy_pass http://$upstream_hostname/$upstream_uri$is_args$args;</div><div>                        proxy_set_header Host $upstream_hostname;</div><div>                        proxy_set_header Range $slice_range;</div><div>                        proxy_ignore_client_abort on;<br></div><div><br></div><div>                        proxy_cache cache_$disk;</div><div>                        proxy_cache_key $upstream_hostname$upstream_uri$slice_range;</div><div>                        proxy_cache_revalidate on;</div><div><br></div><div>                        proxy_cache_bypass $arg_start;</div><div>                        proxy_no_cache $arg_start;</div><div><br></div><div>                        proxy_cache_lock on;</div><div>                        proxy_cache_lock_age 60s;</div><div><br></div><div>                        proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504 http_403;</div><div>                }</div><div>        }</div></div><div><br></div><div><br></div><div><div># uname -a</div><div>Linux localhost.localdomain 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux</div></div><div><br></div><div><div># /usr/sbin/nginx -V</div><div>nginx version: nginx/1.9.11</div><div>built by gcc 4.9.2 (Debian 4.9.2-10)</div><div>built with OpenSSL 1.0.1k 8 Jan 2015</div><div>TLS SNI support enabled</div><div>configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,--as-needed' --with-ipv6</div></div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">WBR,<br><div>Vadim Lazovskiy</div></div></div>
</div></div>