annotate src/mysql/config @ 4207:4fc91bae6f83

Better recheck of dead upstream servers. Previously nginx used to mark backend again as live as soon as fail_timeout passes (10s by default) since last failure. On the other hand, detecting dead backend takes up to 60s (proxy_connect_timeout) in typical situation "backend is down and doesn't respond to any packets". This resulted in suboptimal behaviour in the above situation (up to 23% of requests were directed to dead backend with default settings). More detailed description of the problem may be found here (in Russian): http://mailman.nginx.org/pipermail/nginx-ru/2011-August/042172.html Fix is to only allow one request after fail_timeout passes, and mark backend as "live" only if this request succeeds. Note that with new code backend will not be marked "live" unless "check" request is completed, and this may take a while in some specific workloads (e.g. streaming). This is believed to be acceptable.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 12 Oct 2011 14:22:48 +0000
parents 7cbef16c71a1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
653
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 ngx_addon_name=ngx_mysql
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 HTTP_MODULES="$HTTP_MODULES ngx_http_mysql_test_module"
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 HTTP_DEPS="$HTTP_DEPS $ngx_addon_dir/ngx_mysql.h"
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #CORE_LIBS="$CORE_LIBS -lmd"
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 USE_SHA1=YES
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_mysql.c"
7cbef16c71a1 nginx-0.3.48-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_mysql_test.c"