﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1283	FreeBSD 11 + nginx + apache delay +0.1 second on files greater than 32768 bytes	iHeadRu@…		"Я напишу по-русски.

Freebsd 11. В 10 проблем нет.

1. В httpd.conf ставим 
Listen 127.0.0.1:80
MaxClients 1

2. Кладем файл ihead.txt (35204 байт) в DocumentRoot (/usr/local/www/apache24/data). Файл можно любой, главное, что его размер вместе с заголовками ответа был больше байт 32768.

3. В nginx.conf добавляем в server {...}
location /ihead.txt {
proxy_pass http://127.0.0.1:80;
}

4. находим номера процессов nginx и apache 
ps -aux | grep nginx
ps -aux | grep httpd

5. запускаем ktrace по нужным процессам 
ktrace -p 42260 -t cfinpstuwy -f nginx
ktrace -p 42184 -t cfinpstuwy -f apache

6. Обращаемся к http://IP_nginx/ihead.txt.

7. Останавливаем ktrace
ktrace -C

8. Превращаем дампы в читаемый вид
kdump -E -f nginx > nginx.txt
kdump -E -f apache > apache.txt

9. фиксируется задержка 0.1с при отдаче файла от апача к nginx
 42260 nginx    0.004903 CSW   stop kernel ""kqread""
 42260 nginx    0.110929 CSW   resume kernel ""kqread"" 
 
 42184 httpd    0.000591 CSW   stop kernel ""select""
 42184 httpd    0.199081 CSW   resume kernel ""select""
"	defect	closed	minor	1.13	nginx-core	1.10.x	invalid			FreeBSD freebsd11.build.ihead.ru 11.0-RELEASE-p8 FreeBSD 11.0-RELEASE-p8 #0: Wed Feb 22 06:12:04 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64	"nginx version: nginx/1.13.0
built by clang 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
built with OpenSSL 1.0.2l  25 May 2017
TLS SNI support enabled
configure arguments: --with-http_stub_status_module --with-http_flv_module --without-http_empty_gif_module --without-http_memcached_module --without-http_upstream_ip_hash_module --without-http_browser_module --with-http_ssl_module --without-http_uwsgi_module --without-http_scgi_module --with-openssl=../openssl-1.0.2l --with-http_v2_module --with-pcre-jit --with-http_auth_request_module --with-file-aio"
