Maxim Dounin
December 11, 2011 10:08AM
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1323615378 -10800
# Node ID c162e2269b4c85e4d52f779e5a154ef761f3e6ba
# Parent 9412a31366125763912dff5d592d539eb6102139
Cache lock support for fastcgi, scgi, uwsgi.

diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -380,6 +380,20 @@ static ngx_command_t ngx_http_fastcgi_c
offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_methods),
&ngx_http_upstream_cache_method_mask },

+ { ngx_string("fastcgi_cache_lock"),
+ 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_fastcgi_loc_conf_t, upstream.cache_lock),
+ NULL },
+
+ { ngx_string("fastcgi_cache_lock_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_lock_timeout),
+ NULL },
+
#endif

{ ngx_string("fastcgi_temp_path"),
@@ -2062,6 +2076,8 @@ ngx_http_fastcgi_create_loc_conf(ngx_con
conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
+ conf->upstream.cache_lock = NGX_CONF_UNSET;
+ conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
#endif

conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
@@ -2299,6 +2315,12 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf
conf->cache_key = prev->cache_key;
}

+ ngx_conf_merge_value(conf->upstream.cache_lock,
+ prev->upstream.cache_lock, 0);
+
+ ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
+ prev->upstream.cache_lock_timeout, 5000);
+
#endif

ngx_conf_merge_value(conf->upstream.pass_request_headers,
diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -247,6 +247,20 @@ static ngx_command_t ngx_http_scgi_comma
offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_methods),
&ngx_http_upstream_cache_method_mask },

+ { ngx_string("scgi_cache_lock"),
+ 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_scgi_loc_conf_t, upstream.cache_lock),
+ NULL },
+
+ { ngx_string("scgi_cache_lock_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_lock_timeout),
+ NULL },
+
#endif

{ ngx_string("scgi_temp_path"),
@@ -1039,6 +1053,8 @@ ngx_http_scgi_create_loc_conf(ngx_conf_t
conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
+ conf->upstream.cache_lock = NGX_CONF_UNSET;
+ conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
#endif

conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
@@ -1266,6 +1282,12 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t
conf->cache_key = prev->cache_key;
}

+ ngx_conf_merge_value(conf->upstream.cache_lock,
+ prev->upstream.cache_lock, 0);
+
+ ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
+ prev->upstream.cache_lock_timeout, 5000);
+
#endif

ngx_conf_merge_value(conf->upstream.pass_request_headers,
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -274,6 +274,20 @@ static ngx_command_t ngx_http_uwsgi_comm
offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_methods),
&ngx_http_upstream_cache_method_mask },

+ { ngx_string("uwsgi_cache_lock"),
+ 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_uwsgi_loc_conf_t, upstream.cache_lock),
+ NULL },
+
+ { ngx_string("uwsgi_cache_lock_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_msec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_timeout),
+ NULL },
+
#endif

{ ngx_string("uwsgi_temp_path"),
@@ -1090,6 +1104,8 @@ ngx_http_uwsgi_create_loc_conf(ngx_conf_
conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
+ conf->upstream.cache_lock = NGX_CONF_UNSET;
+ conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
#endif

conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
@@ -1317,6 +1333,12 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t
conf->cache_key = prev->cache_key;
}

+ ngx_conf_merge_value(conf->upstream.cache_lock,
+ prev->upstream.cache_lock, 0);
+
+ ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
+ prev->upstream.cache_lock_timeout, 5000);
+
#endif

ngx_conf_merge_value(conf->upstream.pass_request_headers,

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 5] cache patches

Maxim Dounin 1699 December 11, 2011 10:06AM

[PATCH 1 of 5] Cache: obsolete code removed

Maxim Dounin 668 December 11, 2011 10:06AM

[PATCH 2 of 5] Cache: handling of cache files with long headers

Maxim Dounin 857 December 11, 2011 10:06AM

[PATCH 3 of 5] Cache: only complain on long locked entries

Maxim Dounin 849 December 11, 2011 10:06AM

[PATCH 4 of 5] Cache locks initial implementation

Maxim Dounin 811 December 11, 2011 10:06AM

[PATCH 5 of 5] Cache lock support for fastcgi, scgi, uwsgi

Maxim Dounin 669 December 11, 2011 10:08AM

Re: [PATCH 0 of 5] cache patches

fanboy 906 December 11, 2011 07:00PM

Re: [PATCH 0 of 5] cache patches

Maxim Dounin 697 December 12, 2011 04:54AM

Re: [PATCH 0 of 5] cache patches

António P. P. Almeida 708 December 11, 2011 07:10PM

Re: [PATCH 0 of 5] cache patches

Maxim Dounin 676 December 12, 2011 05:02AM

Re: [PATCH 0 of 5] cache patches

António P. P. Almeida 656 December 12, 2011 05:28AM

Re: [PATCH 0 of 5] cache patches

Maxim Dounin 710 December 12, 2011 05:36AM

Re: [PATCH 0 of 5] cache patches

António P. P. Almeida 984 December 13, 2011 02:42PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready