[PATCH] memcached_force_ranges for memcached upstream
Martin Mlynář
nexus at smoula.net
Tue Apr 21 11:45:18 UTC 2015
Hello,
It would be very nice to have ability to use force_ranges for memcached
cache upstrems. I'm serving about 5MB files from it and resume
is a nice feature which is available on other upstreams and could be
beneficial also here.
Thank you!
Dne 2015-04-21 13:37, Martin Mlynář napsal:
> # HG changeset patch
> # User Martin Mlynář <nexus at smoula.net>
> # Date 1429613281 -7200
> # Tue Apr 21 12:48:01 2015 +0200
> # Node ID 4cb149154501fc638596ab51031f8b3b64da2a7f
> # Parent 1bdfceda86a99a4dc99934181d2f9e2632003ca8
> memcached_force_ranges for memcached upstream
>
> Allow option force_ranges for memcached upstream
>
> diff -r 1bdfceda86a9 -r 4cb149154501
> src/http/modules/ngx_http_memcached_module.c
> --- a/src/http/modules/ngx_http_memcached_module.c Mon Apr 20 17:36:51
> 2015 +0300
> +++ b/src/http/modules/ngx_http_memcached_module.c Tue Apr 21 12:48:01
> 2015 +0200
> @@ -95,6 +95,13 @@
> offsetof(ngx_http_memcached_loc_conf_t, upstream.read_timeout),
> NULL },
>
> + { ngx_string("memcached_force_ranges"),
> +
> NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
> + ngx_conf_set_flag_slot,
> + NGX_HTTP_LOC_CONF_OFFSET,
> + offsetof(ngx_http_memcached_loc_conf_t, upstream.force_ranges),
> + NULL },
> +
> { ngx_string("memcached_next_upstream"),
>
> NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
> ngx_conf_set_bitmask_slot,
> @@ -604,6 +611,7 @@
> conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
>
> conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
> + conf->upstream.force_ranges = NGX_CONF_UNSET;
>
> /* the hardcoded values */
> conf->upstream.cyclic_temp_file = 0;
> @@ -647,6 +655,9 @@
> ngx_conf_merge_msec_value(conf->upstream.read_timeout,
> prev->upstream.read_timeout, 60000);
>
> + ngx_conf_merge_value(conf->upstream.force_ranges,
> + prev->upstream.force_ranges, 0);
> +
> ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
> prev->upstream.next_upstream_timeout,
> 0);
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
--
Martin Mlynář
More information about the nginx-devel
mailing list