Нули везде.<br>Сегодня попробую вынести mysql в рамдиск, если ситуацию исправит то наверное диск не справляется и стоит отдельный сервер под БД делать.<br><br><div class="gmail_quote">2009/2/17 Alexey Kovyrin <span dir="ltr">&lt;<a href="mailto:alexey@kovyrin.net">alexey@kovyrin.net</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">cat /proc/sys/net/ipv4/tcp_tw_recycle<br>
cat /proc/sys/net/ipv4/tcp_tw_reuse<br>
<br>
2009/2/16 Алексей Загородников &lt;<a href="mailto:admin@tltorrent.ru">admin@tltorrent.ru</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt; Ресурсов харда вроде достаточно, там рейд0+1 собран на 4 дисках.<br>
&gt;<br>
&gt; Вот интересно былобы чтото найти про настройку Linux, такое ощущение что<br>
&gt; нехватает свободных сокетов ему, много соединений висит в TIME_WAIT.<br>
&gt; Никаких файрволов нет, поддержка nf_conntrack вырезана из ядра.<br>
&gt;<br>
&gt;<br>
&gt; 17 февраля 2009 г. 1:17 пользователь Асафов Сергей aka MurZiK<br>
&gt; &lt;<a href="mailto:Asafchik@inbox.ru">Asafchik@inbox.ru</a>&gt; написал:<br>
&gt;&gt;<br>
&gt;&gt; Нагрузка на диски какая?Может в пик нагрузки просто недостаточно ресурсов<br>
&gt;&gt; жёсткого диска, чтобы считать и отдать файлы?<br>
&gt;&gt;<br>
&gt;&gt; ----- Original Message -----<br>
&gt;&gt; From: Алексей Загородников<br>
&gt;&gt; To: <a href="mailto:nginx-ru@sysoev.ru">nginx-ru@sysoev.ru</a><br>
&gt;&gt; Sent: Monday, February 16, 2009 11:16 PM<br>
&gt;&gt; Subject: Периодические подвисания при загрузке статики в nginx<br>
&gt;&gt; Приветствую всех, возник следующий вопрос<br>
&gt;&gt; В городской сети поднят торрент-трекер, 20000 пользователей, примерно 5000<br>
&gt;&gt; уников в сутки, и 4000 одновременно подключенных торрент клиентов.<br>
&gt;&gt; Все это реализовано на nginx + fast-cgi, fcgi и nginx прикручены через<br>
&gt;&gt; unix socket, движек трекера - torrentpier. Конфигурация железки: 2*XeonE5410<br>
&gt;&gt; / 8Gb / RAID0+1<br>
&gt;&gt; В пик нагрузки начал наблюдать такие проблемы, странички через раз то<br>
&gt;&gt; открываются с отличной скорость, то зависает на загрузке от 10 до 200<br>
&gt;&gt; секунд, причем после загрузки показывается что пхп генерится как и обычно за<br>
&gt;&gt; 0,056сек.<br>
&gt;&gt; Попробовал испытать через ab просто статичную картинку, эффект тотже,<br>
&gt;&gt; просто наглухо виснет тест и все. В это время в нетстате клиента видно что<br>
&gt;&gt; соединения висят в SYN_SENT.<br>
&gt;&gt;<br>
&gt;&gt; Перепробовал уже большинство возможных вариантов найденных в инете, ничего<br>
&gt;&gt; не дает улучшения в производительности.<br>
&gt;&gt; Может кто сталкивался с подобной проблемой, подскажите решение.<br>
&gt;&gt;<br>
&gt;&gt; nginx version: nginx/0.7.34<br>
&gt;&gt;<br>
&gt;&gt; Вот примерный конфиг этого чуда:<br>
&gt;&gt; user nginx nginx;<br>
&gt;&gt; worker_processes 50;<br>
&gt;&gt; worker_rlimit_nofile 20192;<br>
&gt;&gt;<br>
&gt;&gt; error_log /var/log/nginx/error_log info;<br>
&gt;&gt;<br>
&gt;&gt; events {<br>
&gt;&gt; &nbsp; &nbsp; worker_connections &nbsp;50192;<br>
&gt;&gt; &nbsp; &nbsp; use epoll;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; http {<br>
&gt;&gt; &nbsp; &nbsp; include &nbsp; &nbsp; &nbsp; &nbsp;/etc/nginx/mime.types;<br>
&gt;&gt; &nbsp; &nbsp; default_type &nbsp; &nbsp;application/octet-stream;<br>
&gt;&gt; &nbsp; &nbsp; client_max_body_size 1000m;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; server_names_hash_bucket_size 64;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; log_format main<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &#39;$remote_addr - $remote_user [$time_local] &#39;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;&quot;$request&quot; $status $bytes_sent &#39;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &#39;&quot;$http_referer&quot; &quot;$http_user_agent&quot; &#39;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &#39;&quot;$gzip_ratio&quot;&#39;;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; client_header_timeout &nbsp; &nbsp;3m;<br>
&gt;&gt; &nbsp; &nbsp; client_body_timeout &nbsp; &nbsp;3m;<br>
&gt;&gt; &nbsp; &nbsp; send_timeout &nbsp; &nbsp; &nbsp; &nbsp;3m;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; connection_pool_size &nbsp; &nbsp; &nbsp; &nbsp;2024;<br>
&gt;&gt; &nbsp; &nbsp; client_header_buffer_size &nbsp; &nbsp;1k;<br>
&gt;&gt; &nbsp; &nbsp; large_client_header_buffers &nbsp; &nbsp;4 2k;<br>
&gt;&gt; &nbsp; &nbsp; request_pool_size &nbsp; &nbsp; &nbsp; &nbsp;4k;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; gzip off;<br>
&gt;&gt; # &nbsp; &nbsp;gzip_min_length &nbsp; &nbsp;1100;<br>
&gt;&gt; # &nbsp; &nbsp;gzip_buffers &nbsp; &nbsp;4 8k;<br>
&gt;&gt; # &nbsp; &nbsp;gzip_types &nbsp; &nbsp;text/plain;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; output_buffers &nbsp; &nbsp;1 32k;<br>
&gt;&gt; &nbsp; &nbsp; postpone_output &nbsp; &nbsp;1460;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; sendfile &nbsp; &nbsp;on;<br>
&gt;&gt; &nbsp; &nbsp; tcp_nopush &nbsp; &nbsp;on;<br>
&gt;&gt; &nbsp; &nbsp; tcp_nodelay &nbsp; &nbsp;on;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; keepalive_timeout &nbsp; &nbsp;0;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; lingering_time 30;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; lingering_timeout 2;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; reset_timedout_connection on;<br>
&gt;&gt;<br>
&gt;&gt; # &nbsp; &nbsp;ignore_invalid_headers &nbsp; &nbsp;on;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; index index.html;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; server {<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listen 80;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; access_log off;<br>
&gt;&gt; # &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;access_log /var/log/nginx/access_tr.log;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; error_log /var/log/nginx/error_tr.log;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; server_name_in_redirect off;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server_name <a href="http://tltorrent.ru" target="_blank">tltorrent.ru</a> <a href="http://www.tltorrent.ru" target="_blank">www.tltorrent.ru</a> <a href="http://tltorrent.net.ru" target="_blank">tltorrent.net.ru</a><br>

&gt;&gt; <a href="http://www.tltorrent.net.ru" target="_blank">www.tltorrent.net.ru</a> <a href="http://tr.xtlt.ru" target="_blank">tr.xtlt.ru</a> <a href="http://test.tr" target="_blank">test.tr</a>;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; error_page &nbsp;502 &nbsp;/errors/502.html;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; error_page &nbsp;403 &nbsp;/errors/403.html;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; location = /nginx_status {<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stub_status on;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; access_log &nbsp; off;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allow all;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; /var/www/tltorrent;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; index &nbsp;index.html index.htm index.php;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location ~ .php$ {<br>
&gt;&gt; # &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_pass &nbsp; <a href="http://127.0.0.1:1026" target="_blank">127.0.0.1:1026</a>;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass unix:/tmp/fcgi.sock;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_index &nbsp;index.php;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_connect_timeout 60;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_read_timeout 60;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_send_timeout 60;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SCRIPT_FILENAME<br>
&gt;&gt; /var/www/tltorrent$fastcgi_script_name;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;QUERY_STRING &nbsp; &nbsp; &nbsp; $query_string;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;REQUEST_METHOD &nbsp; &nbsp; $request_method;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;CONTENT_TYPE &nbsp; &nbsp; &nbsp; $content_type;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;CONTENT_LENGTH &nbsp; &nbsp; $content_length;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SCRIPT_NAME &nbsp; &nbsp; &nbsp; &nbsp;$fastcgi_script_name;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;REQUEST_URI &nbsp; &nbsp; &nbsp; &nbsp;$request_uri;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;DOCUMENT_URI &nbsp; &nbsp; &nbsp; $document_uri;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;DOCUMENT_ROOT &nbsp; &nbsp; &nbsp;$document_root;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SERVER_PROTOCOL &nbsp; &nbsp;$server_protocol;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;GATEWAY_INTERFACE &nbsp;CGI/1.1;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SERVER_SOFTWARE &nbsp; &nbsp;nginx;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;REMOTE_ADDR &nbsp; &nbsp; &nbsp; &nbsp;$remote_addr;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;REMOTE_PORT &nbsp; &nbsp; &nbsp; &nbsp;$remote_port;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SERVER_ADDR &nbsp; &nbsp; &nbsp; &nbsp;$server_addr;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SERVER_PORT &nbsp; &nbsp; &nbsp; &nbsp;$server_port;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SERVER_NAME &nbsp; &nbsp; &nbsp; &nbsp;$server_name;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; #$http_x_forwarded_host;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;HTTP_HOST &nbsp; &nbsp; &nbsp; &nbsp;$http_host;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; #$http_x_forwarded_host;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location /forum/ub/ {<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewrite ^/forum/ub/(.*).png$ /forum/ub/ub.php?u=$1;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Alexey Kovyrin<br>
<a href="http://kovyrin.info/" target="_blank">http://kovyrin.info/</a><br>
</font></blockquote></div><br>