<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title></title>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
  margin: 5px 5px 5px 5px;
  background-color: #ffffff;
}
/* ---------- Text Styles ---------- */
hr { color: #000000}
body, table /* Normal text */
{
 font-size: 9pt;
 font-family: 'Courier New';
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
}
span.rvts1 /* Heading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #0000ff;
}
span.rvts2 /* Subheading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #000080;
}
span.rvts3 /* Keywords */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-style: italic;
 color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
span.rvts6
{
 font-size: 8pt;
 font-family: 'arial';
 font-style: italic;
 color: #c0c0c0;
}
a.rvts7, span.rvts7
{
 font-size: 8pt;
 font-family: 'arial';
 color: #0000ff;
 text-decoration: underline;
}
/* ---------- Para Styles ---------- */
p,ul,ol /* Paragraph Style */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
 text-align: center;
}
--></style>
</head>
<body>

<p>Приветствую,</p>
<p><br></p>
<p>Есть вдс, ей дано очень много ресурсов. nginx ест проц.</p>
<p>OpenVZ, 2.6.18-8.1.8.el5.028stab039.1, failcnt нету, памяти, проца - достаточно.</p>
<p><br></p>
<p>&nbsp; PID USER &nbsp; &nbsp; &nbsp;PR &nbsp;NI &nbsp;VIRT &nbsp;RES &nbsp;SHR S %CPU %MEM &nbsp; &nbsp;TIME+ &nbsp;COMMAND</p>
<p>31986 nobody &nbsp; &nbsp;17 &nbsp; 0 &nbsp;4904 3472 &nbsp;692 R &nbsp; 40 &nbsp;0.2 &nbsp; 4:50.57 nginx</p>
<p>13398 nobody &nbsp; &nbsp;17 &nbsp; 0 &nbsp;4840 3400 &nbsp;692 R &nbsp; 39 &nbsp;0.2 &nbsp; 1:19.98 nginx</p>
<p><br></p>
<p>Было на 0.5.31, не исчезло после обновления до 0.5.33.</p>
<p>Вероятнее всего в это время nginx отдает проксированные ответы апача, который получает их от пхп скрипта. Пхп скрипт, вероятнее всего, отдает 3х мегабайтные файлы с диска. Про интернал редиректы я в курсе, но скрипты не мои и править нельзя. Да и nginx независимо от, по моему мнению, не должен есть столько проца, скорее его должны бы есть те скрипты, но с нагрузкой в два потока, по идее, не должны и они.</p>
<p><br></p>
<p>Как искать причины ? Кусок конфига ниже.</p>
<p><br></p>
<p>========================</p>
<p>user &nbsp;nobody nogroup;</p>
<p>worker_processes &nbsp;1;</p>
<p>pid /var/run/nginx.pid;</p>
<p>error_log &nbsp;/var/log/nginx.error_log &nbsp;crit; # [ debug | info | notice | warn | error | crit ]</p>
<p>events {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; worker_connections &nbsp;2048;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; use epoll; # use [ kqueue | rtsig | epoll | /dev/poll | select | poll ];</p>
<p>}</p>
<p>http {</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;[...]
<br>&nbsp; &nbsp; &nbsp; &nbsp; client_header_timeout &nbsp;3m;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; client_body_timeout &nbsp; &nbsp;3m;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; send_timeout &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3m;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; client_header_buffer_size &nbsp; &nbsp;1k;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; large_client_header_buffers &nbsp;4 4k;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; gzip &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; on;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; gzip_min_length &nbsp;500;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; gzip_proxied &nbsp; &nbsp; expired no-cache no-store private auth;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; gzip_types &nbsp; &nbsp; &nbsp; text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; gzip_comp_level 5;</p>
<p><br></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; output_buffers &nbsp; 1 32k;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; postpone_output &nbsp;1460;</p>
<p><br></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; sendfile &nbsp; &nbsp; &nbsp; &nbsp;on;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; tcp_nopush &nbsp; &nbsp; &nbsp;on;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; tcp_nodelay &nbsp; &nbsp; on;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; #keepalive_timeout &nbsp;0;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; keepalive_timeout &nbsp;65 20;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server_names_hash_max_size &nbsp; &nbsp; &nbsp;2048;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server_names_hash_bucket_size &nbsp; 64;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; server {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listen 80;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; server_name &nbsp;***.ru www.***.ru;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location / {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_pass &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;http://127.0.0.1:81;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header &nbsp; &nbsp;X-Real-IP &nbsp;$remote_addr;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header &nbsp; &nbsp;X-Forwarded-For &nbsp;$proxy_add_x_forwarded_for;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header &nbsp; &nbsp;X-Accel-Internal /internal_xxx;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy_set_header &nbsp; &nbsp;Host $http_host;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location /internal_xxx/ {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp;/home/admin/www/***.ru;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewrite &nbsp; ^/internal_xxx/(.*)$ /$1 break;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; internal;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Static files location</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location ~* ^.+\.(swf|xml|gif|jpg|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|ods|arj)$ {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; root &nbsp; &nbsp;/home/admin/www/***.ru;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts6>--&nbsp;</span></p>
<p><span class=rvts6>Best regards,</span></p>
<p><span class=rvts6>&nbsp;Nick &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><a class=rvts7 href="mailto:mail@knutov.com">mailto:mail@knutov.com</a></p>

</body></html>