annotate src/core/ngx_murmurhash.h @ 4010:74a93d3fdd85
Fixing cpu hog with all upstream servers marked "down".
The following configuration causes nginx to hog cpu due to infinite loop
in ngx_http_upstream_get_peer():
upstream backend {
server 127.0.0.1:8080 down;
server 127.0.0.1:8080 down;
}
server {
...
location / {
proxy_pass http://backend;
}
}
Make sure we don't loop infinitely in ngx_http_upstream_get_peer() but stop
after resetting peer weights once.
Return 0 if we are stuck. This is guaranteed to work as peer 0 always exists,
and eventually ngx_http_upstream_get_round_robin_peer() will do the right
thing falling back to backup servers or returning NGX_BUSY.
author |
Maxim Dounin <mdounin@mdounin.ru> |
date |
Thu, 18 Aug 2011 16:52:38 +0000 |
parents |
203eb026ec07 |
children |
d620f497c50f |
rev |
line source |
3891
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
|
4 */
|
|
5
|
|
6
|
|
7 #ifndef _NGX_MURMURHASH_H_INCLUDED_
|
|
8 #define _NGX_MURMURHASH_H_INCLUDED_
|
|
9
|
|
10
|
|
11 #include <ngx_config.h>
|
|
12 #include <ngx_core.h>
|
|
13
|
|
14
|
|
15 uint32_t ngx_murmur_hash2(u_char *data, size_t len);
|
|
16
|
|
17
|
|
18 #endif /* _NGX_CRC_H_INCLUDED_ */
|