При наличии проблемы нужно не гадать и тыкаться, а диагностировать.<br><br>Для анализа использования памяти, можно использовать pmap. Запускаешь pmap на первом сервере и на втором, и анализируй карты памяти. Пример:<br><br>
pmap `pgrep nginx`<br>1208: nginx: master process /usr/sbin/nginx<br>0000000000400000 592K r-x-- /usr/sbin/nginx<br>0000000000693000 4K r---- /usr/sbin/nginx<br>0000000000694000 64K rw--- /usr/sbin/nginx<br>
00000000006a4000 56K rw--- [ anon ]<br>00000000021e7000 268K rw--- [ anon ]<br>....<br>00007f7bc6946000 4K r---- /lib/<a href="http://ld-2.11.1.so">ld-2.11.1.so</a><br>00007f7bc6947000 4K rw--- /lib/<a href="http://ld-2.11.1.so">ld-2.11.1.so</a><br>
00007f7bc6948000 4K rw--- [ anon ]<br>00007fff88492000 84K rw--- [ stack ]<br>00007fff885ff000 4K r-x-- [ anon ]<br>ffffffffff600000 4K r-x-- [ anon ]<br> total 17420K<br><br>По процесору, для начала можно пыпытатся strace -cfp PID:<br>
<br>strace -cfp 1209<br>Process 1209 attached - interrupt to quit<br>^CProcess 1209 detached<br>% time seconds usecs/call calls errors syscall<br>------ ----------- ----------- --------- --------- ----------------<br>
67.36 0.000097 1 83 writev<br> 19.44 0.000028 1 42 write<br> 13.19 0.000019 0 54 epoll_ctl<br> 0.00 0.000000 0 43 close<br>
0.00 0.000000 0 48 ioctl<br> 0.00 0.000000 0 639 285 readv<br><br>Дальше можно google-perftool, OProfile и т.д.<br><br><div class="gmail_quote">3 марта 2011 г. 16:46 пользователь Denis Kot <span dir="ltr"><<a href="mailto:denis.kot@gmail.com">denis.kot@gmail.com</a>></span> написал:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Перенес сайт на новый сервер. На старом стоял CentOS и nginx + php-fpm<br>
5.2.11 собранные из сырцов. На новом сервер Gentoo и nginx естественно<br>
собран из сырцов так же.<br>
На новом сервере nginx постоянно находится в самом верху вывода команды top.<br>
<br>
Старый сервер:<br>
# nginx -V<br>
nginx version: nginx/0.8.29<br>
TLS SNI support disabled<br>
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf<br>
--http-log-path=/var/log/nginx/access_log<br>
--error-log-path=/var/log/nginx/error_log<br>
--pid-path=/var/run/nginx.pid<br>
--http-client-body-temp-path=/var/tmp/nginx/client<br>
--http-proxy-temp-path=/var/tmp/nginx/proxy<br>
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --with-md5-asm<br>
--with-md5=/usr/include --with-sha1-asm --with-sha1=/usr/include<br>
--with-http_addition_module --with-http_realip_module<br>
--with-http_ssl_module --with-http_perl_module<br>
--with-http_stub_status_module --without-mail_pop3_module<br>
--without-mail_smtp_module --without-mail_imap_module<br>
<br>
PHP 5.2.11<br>
<br>
Новый сервер:<br>
# nginx -V<br>
nginx version: nginx/0.8.53<br>
TLS SNI support enabled<br>
configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx<br>
--conf-path=/etc/nginx/nginx.conf<br>
--error-log-path=/var/log/nginx/error_log<br>
--pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock<br>
--user=nginx --group=nginx --with-cc-opt=-I/usr/include<br>
--with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access_log<br>
--http-client-body-temp-path=/var/tmp/nginx/client<br>
--http-proxy-temp-path=/var/tmp/nginx/proxy<br>
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi<br>
--http-scgi-temp-path=/var/tmp/nginx/scgi<br>
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-file-aio<br>
--with-aio_module --with-pcre --without-http_auth_basic_module<br>
--without-http_autoindex_module --without-http_browser_module<br>
--without-http_empty_gif_module --without-http_geo_module<br>
--without-http_limit_req_module --without-http_limit_zone_module<br>
--without-http_map_module --without-http_memcached_module<br>
--without-http_referer_module --without-http_scgi_module<br>
--without-http_ssi_module --without-http_split_clients_module<br>
--without-http_userid_module --without-http_uwsgi_module<br>
--with-http_addition_module --with-http_gzip_static_module<br>
--with-http_realip_module --with-http_stub_status_module<br>
--with-http_realip_module --with-http_ssl_module<br>
--without-mail_imap_module --without-mail_pop3_module<br>
--without-mail_smtp_module<br>
<br>
PHP 5.3.5-pl0-gentoo<br>
<br>
Конфиг nginx перенесен со старого сервера без правок.<br>
<br>
Вывод top такой:<br>
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND<br>
19970 nginx 20 0 124m 36m 864 S 28 0.9 18:02.17 nginx<br>
19969 nginx 20 0 129m 41m 864 R 26 1.0 19:09.88 nginx<br>
24247 nginx 20 0 216m 16m 9m R 15 0.4 0:03.00 php-fpm<br>
24289 nginx 20 0 215m 12m 7552 R 9 0.3 0:00.99 php-fpm<br>
24262 nginx 20 0 218m 25m 18m R 9 0.6 0:02.14 php-fpm<br>
<br>
Иногда CPU у nginx доходит до 50%<br>
<br>
<br>
Как посмотреть чем занят nginx?<br>
Может ли влиять TLS SNI support enabled/disabled?<br>
<br>
Denis Kot<br>
<br>
_______________________________________________<br>
nginx-ru mailing list<br>
<a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx-ru" target="_blank">http://nginx.org/mailman/listinfo/nginx-ru</a><br>
</blockquote></div><br>