Интересно почитать… Блог в котором есть много интересной информации…

16 августа 2013

Анализ логов Nginx

Категория: linux — dmitriano @ 9:09

Яндекс метрика сообщает следующее:

Согласно данным мониторинга, обнаружены проблемы с доступностью сайта:
slogpost.ru (15 августа в 21:58).

смотрим когда приходил паук:

grep '15/Aug/2013:21.*YandexMetrika' slogpost.access.log
95.108.129.207 - - [15/Aug/2013:21:08:39 +0400] "GET / HTTP/1.1" 200 15135 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon1)"
95.108.129.207 - - [15/Aug/2013:21:10:50 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon1)"
213.180.206.197 - - [15/Aug/2013:21:16:17 +0400] "GET / HTTP/1.1" 200 15135 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon2)"
5.255.210.93 - - [15/Aug/2013:21:16:48 +0400] "GET / HTTP/1.1" 200 15135 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon3)"
95.108.129.207 - - [15/Aug/2013:21:30:31 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon1)"
213.180.206.197 - - [15/Aug/2013:21:35:18 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon2)"
5.255.210.93 - - [15/Aug/2013:21:36:48 +0400] "GET / HTTP/1.1" 200 15135 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon3)"
213.180.206.197 - - [15/Aug/2013:21:37:28 +0400] "GET / HTTP/1.1" 200 15134 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon2)"
95.108.129.207 - - [15/Aug/2013:21:50:51 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon1)"
5.255.210.93 - - [15/Aug/2013:21:56:01 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon3)"
213.180.206.197 - - [15/Aug/2013:21:57:47 +0400] "GET / HTTP/1.1" 200 15135 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon2)"
5.255.210.93 - - [15/Aug/2013:21:58:09 +0400] "GET / HTTP/1.1" 499 0 "-" "Mozilla/5.0 (compatible; YandexMetrika/2.0; +http://yandex.com/bots mon3)"

действительно паук приходил в 21:58 с адреса 5.255.210.93. Смотрим error log:

grep '08/15 21' slogpost.error.log
2013/08/15 21:52:29 [info] 19860#0: *23403 client 190.222.129.13 closed keepalive connection
2013/08/15 21:52:29 [info] 19858#0: *23364 client 190.222.129.13 closed keepalive connection
2013/08/15 21:56:01 [info] 19857#0: *23747 client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 5.255.210.93, server: slogpost.ru, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/www-slogpost.sock:", host: "slogpost.ru"
2013/08/15 21:57:47 [info] 19859#0: *23847 client 213.180.206.197 closed keepalive connection
2013/08/15 21:58:09 [info] 19859#0: *23862 client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 5.255.210.93, server: slogpost.ru, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/www-slogpost.sock:", host: "slogpost.ru"
2013/08/15 21:59:27 [info] 19859#0: *23910 client 66.249.72.87 closed keepalive connection

при обращении с адреса 5.255.210.93 два раза была одна и та же ошибка.

Вот, что пишут на форуме Nginx-а:

In nginx, 499 means "client has closed connection". However, guys know

little about 499 as it’s not defined by rfc2616 but by nginx.

When a client sent a request, and closed the connection without waiting for

the response, a 499 code occurs. If there’re a lot of 499s in your

access_log, it’s mostly caused by the slow back-ends (too slow for your

users to wait). You may have to optimize your website performance.

499 is logged by nginx if client closes connection before nginx

was able to send anything to client.

Large number of 499 may indicate that something is wrong on your

server, e.g. response generation takes too long. Some number is

usually ok: you are expected to have some users closing

connections prematurely due to their internal reasons (e.g. bad

connectivity, closing browser while loading page and so on).

User Access Manager работает медленно на больших блогах

ссылки:

  1. http://wordpress.org/support/topic/plugin-user-access-manager-114-very-slow-1?replies=9
  2. http://wordpress.org/support/topic/plugin-user-access-manager-very-slow-on-large-blog-with-user-logged-on?replies=2

Nginx slow log показывает следующее:

script_filename = /home/slogpost/www/index.php
[0x000000000275bbd0] mysql_query() /home/slogpost/www/wp-includes/wp-db.php:1199
[0x000000000275b840] query() /home/slogpost/www/wp-includes/wp-db.php:1437
[0x000000000275b4b0] get_var() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamUserGroup.class.php:926
[0x000000000275a9e0] _isPostInCategory() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamUserGroup.class.php:951
[0x000000000275a060] _getFullPost() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamUserGroup.class.php:691
[0x0000000002759dd8] _getSingleObject() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamUserGroup.class.php:592
[0x0000000002759330] objectIsMember() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamAccessHandler.class.php:323
[0x0000000002758368] getUserGroupsForObject() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UamAccessHandler.class.php:386
[0x0000000002757638] checkObjectAccess() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UserAccessManager.class.php:1674
[0x0000000002757038] _getTerm() /home/slogpost/www/wp-content/plugins/user-access-manager/class/UserAccessManager.class.php:1733
[0x00007fffecd59620] showTerms() unknown:0
[0x0000000002756708] call_user_func_array() /home/slogpost/www/wp-includes/plugin.php:173
[0x0000000002752948] apply_filters() /home/slogpost/www/wp-includes/taxonomy.php:1465
[0x00000000027524b0] get_terms() /home/slogpost/www/wp-includes/category.php:51
[0x0000000002751520] get_categories() /home/slogpost/www/wp-includes/category-template.php:445
[0x0000000002750e78] wp_list_categories() /home/slogpost/www/wp-includes/default-widgets.php:485
[0x00000000027509f0] widget() /home/slogpost/www/wp-includes/widgets.php:182
[0x00007fffecd59920] display_callback() unknown:0
[0x000000000274fc00] call_user_func_array() /home/slogpost/www/wp-includes/widgets.php:904
[0x000000000274f6d8] dynamic_sidebar() /home/slogpost/www/wp-content/themes/classic/sidebar.php:12

кстати вот такие вещи логах PHP-FPM не нужны, так как Nginx всё равно логи PHP-FPM перехватывает:

[global]

error_log = /var/log/php-fpm/test1-php-error.log
Линии 3D/Шарики 3D

Комментариев нет »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

SlogPost.ru