HttpMemcachedModule
(Difference between revisions)
Ensiferous (Talk | contribs) m (→Synopsis) |
|||
| (2 intermediate revisions by one user not shown) | |||
| Line 14: | Line 14: | ||
location @fallback { | location @fallback { | ||
| − | proxy_pass backend; | + | proxy_pass http://backend; |
} | } | ||
} | } | ||
| Line 21: | Line 21: | ||
= Directives = | = Directives = | ||
== memcached_pass == | == memcached_pass == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_pass.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
The backend should set the data in memcached. The memcached key is "/uri?args". | The backend should set the data in memcached. The memcached key is "/uri?args". | ||
| Line 32: | Line 28: | ||
== memcached_connect_timeout == | == memcached_connect_timeout == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_connect_timeout.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
The timeout for connecting to memcached. | The timeout for connecting to memcached. | ||
== memcached_read_timeout == | == memcached_read_timeout == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_read_timeout.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
The timeout for reading from memcached. | The timeout for reading from memcached. | ||
== memcached_send_timeout == | == memcached_send_timeout == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_send_timeout.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
The timeout for sending to memcached. | The timeout for sending to memcached. | ||
== memcached_buffer_size == | == memcached_buffer_size == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_buffer_size.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
The recv/send buffer size, in bytes. | The recv/send buffer size, in bytes. | ||
== memcached_next_upstream == | == memcached_next_upstream == | ||
| − | + | <include wikitext nopre src="http://wiki.nginx.org/nginx.org/http/ngx_http_memcached_module/memcached_next_upstream.txt" /> | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
Which failure conditions should cause the request to be forwarded to another upstream server? Applies only when the value in memcached_pass is an upstream with two or more servers. | Which failure conditions should cause the request to be forwarded to another upstream server? Applies only when the value in memcached_pass is an upstream with two or more servers. | ||
Latest revision as of 06:12, 6 November 2012
Contents |
[edit] Synopsis
You can use this module to perform simple caching.
server { location / { set $memcached_key $uri; memcached_pass name:11211; default_type text/html; error_page 404 @fallback; } location @fallback { proxy_pass http://backend; } }
[edit] Directives
[edit] memcached_pass
| Syntax: | memcached_pass address |
| Default: | |
| Context: |
location if in location |
| Reference: | memcached_pass |
The backend should set the data in memcached. The memcached key is "/uri?args".
Since 0.5.9 the memcached key is now in $memcached_key.
[edit] memcached_connect_timeout
| Syntax: | memcached_connect_timeout time |
| Default: | 60s |
| Context: |
http server location |
| Reference: | memcached_connect_timeout |
The timeout for connecting to memcached.
[edit] memcached_read_timeout
| Syntax: | memcached_read_timeout time |
| Default: | 60s |
| Context: |
http server location |
| Reference: | memcached_read_timeout |
The timeout for reading from memcached.
[edit] memcached_send_timeout
| Syntax: | memcached_send_timeout time |
| Default: | 60s |
| Context: |
http server location |
| Reference: | memcached_send_timeout |
The timeout for sending to memcached.
[edit] memcached_buffer_size
| Syntax: | memcached_buffer_size size |
| Default: | 4k|8k |
| Context: |
http server location |
| Reference: | memcached_buffer_size |
The recv/send buffer size, in bytes.
[edit] memcached_next_upstream
| Syntax: |
memcached_next_upstream error | timeout | invalid_response | not_found | off ... |
| Default: | error timeout |
| Context: |
http server location |
| Reference: | memcached_next_upstream |
Which failure conditions should cause the request to be forwarded to another upstream server? Applies only when the value in memcached_pass is an upstream with two or more servers.
[edit] Variables
[edit] $memcached_key
The value of the memcached key.
[edit] References
[1] Speeding up your nginx server with memcached
[edit] See Also
- The 3rd-party memc module that supports almost the whole memcached TCP protocol.
- The 3rd-party Enhanced Memcached Module add some features : custom HTTP headers, hash keys, flush memcached and so on.










