Invalid parsed value for keys_zone. Is this a problem?

caruccio nginx-forum at
Tue Jan 18 16:35:10 MSK 2011


driven by a wrong undestand of proxy_cache's keys_zone parameter I have
set it to a very high value:

    proxy_cache_path	/tmp/cache levels=2:2:2 keys_zone=cache:10000m
max_size=50g inactive=5m;

What happens is that 10G should be 10485760000, not 1895825408:

Breakpoint 3, ngx_http_file_cache_set_slot (cf=0xbfffef58,
cmd=0x80ee980, conf=0x0) at src/http/ngx_http_file_cache.c:1598
(gdb) p s
$1 = {len = 6, data = 0x811e2a3 "10000m"}
1598	                size = ngx_parse_size(&s);
(gdb) p size
$2 = 1895825408
(gdb) n
1599	                if (size > 8191) {
(gdb) n
1600	                    continue;
(gdb) quit

Even being an unreasonable value for in-memory cache, shouldn't this
unexpected result be avoided?

Posted at Nginx Forum:,167197,167197#msg-167197

More information about the nginx mailing list