Add docs for tap, and update all other documentation.
[m6w6/libmemcached] / docs / libmemcached_configuration.rst
1 ========================
2 Configuring Libmemcached
3 ========================
4
5 --------
6 SYNOPSIS
7 --------
8
9
10 .. c:function:: memcached_st *memcached_create_with_options(const char *string, size_t string_length)
11
12
13 .. c:function:: memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, char *error_buffer, size_t error_buffer_size)
14
15 Compile and link with -lmemcached
16
17
18
19 -----------
20 DESCRIPTION
21 -----------
22
23 Libmemcached implements a custom language for configuring and modifying
24 servers. By passing in an option string you can generate a memcached_st object
25 that you can use in your application directly.
26
27 .. describe:: --SERVER=<servername>:<optional_port>/?<optional_weight>
28
29 Provide a servername to be used by the client. Providing a weight will cause weighting to occur with all hosts with each server getting a default weight of 1.
30
31 .. describe:: --VERIFY-KEY
32
33 Verify that keys that are being used fit within the design of the protocol being used.
34
35 .. describe:: --REMOVE_FAILED_SERVERS
36
37 Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS.
38
39 .. describe:: --BINARY-PROTOCOL
40
41 Force all connections to use the binary protocol.
42
43 .. describe:: --BUFFER-REQUESTS
44
45 Enable MEMCACHED_BEHAVIOR_BUFFER_REQUESTS.
46
47 .. describe:: --CONFIGURE-FILE=
48
49 Provide a configuration file to be used to load requests. Beware that by using a configuration file libmemcached will reset memcached_st based on information only contained in the file.
50
51 .. describe:: --CONNECT-TIMEOUT=
52
53 Enable MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT.
54
55 .. describe:: --DISTRIBUTION=
56
57 Set the distribution model used by the client. See :manpage:`` for more details.
58
59 .. describe:: --HASH=
60
61 Set the hashing alogrthm used for placing keys on servers.
62
63 .. describe:: --HASH-WITH-NAMESPACE
64
65 When enabled the prefix key will be added to the key when determining which
66 server to store the data in.
67
68 .. describe:: --NOREPLY
69
70 Enable "no reply" for all calls that support this. It is highly recommended
71 that you use this option with the binary protocol only.
72
73 .. describe:: --NUMBER-OF-REPLICAS=
74
75 Set the nummber of servers that keys will be replicated to.
76
77 .. describe:: --RANDOMIZE-REPLICA-READ
78
79 Select randomly the server within the replication pool to read from.
80
81 .. describe:: --SORT-HOSTS
82
83 When adding new servers always calculate their distribution based on sorted naming order.
84
85 .. describe:: --SUPPORT-CAS
86
87 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SUPPORT_CAS
88
89 .. describe:: --USE-UDP
90
91 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_USE_UDP
92
93 .. describe:: --NAMESPACE=
94
95 A namespace is a container that provides context for keys, only other
96 requests that know the namespace can access these values. This is
97 accomplished by prepending the namespace value to all keys.
98
99
100 ************
101 I/O Options:
102 ************
103
104 .. describe:: --TCP-NODELAY
105
106 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_NODELAY
107
108 .. describe:: --TCP-KEEPALIVE
109
110 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
111
112 .. describe:: --RETRY-TIMEOUT=
113
114 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
115
116 .. describe:: --SERVER-FAILURE-LIMIT=
117
118 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
119
120 .. describe:: --SND-TIMEOUT=
121
122 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SND_TIMEOUT
123
124 .. describe:: --SOCKET-RECV-SIZE=
125
126 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
127
128 .. describe:: --SOCKET-SEND-SIZE=
129
130 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
131
132 .. describe:: --POLL-TIMEOUT=
133
134 That sets the value of the timeout used by :manpage: `poll()`.
135
136 .. describe:: --IO-BYTES-WATERMARK=
137
138 .. describe:: --IO-KEY-PREFETCH=
139
140 .. describe:: --IO-MSG-WATERMARK=
141
142 .. describe:: --TCP-KEEPIDLE
143
144 .. describe:: --RCV-TIMEOUT=
145
146
147
148 ******
149 Other:
150 ******
151
152
153 .. describe:: INCLUDE
154
155 Include a file in configuration. Unlike --CONFIGURE-FILE= this will not reset memcached_st
156
157 .. describe:: RESET
158
159 Reset memcached_st and continue to process.
160
161 .. describe:: END
162
163 End configutation processing.
164
165 .. describe:: ERROR
166
167 End configutation processing and throw an error.
168
169
170 ------
171 RETURN
172 ------
173
174
175 memcached_create_with_options() returns a pointer to the memcached_st that was
176 created (or initialized). On an allocation failure, it returns NULL.
177
178
179
180 -------
181 EXAMPLE
182 -------
183
184
185 .. code-block:: c
186
187 const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
188 memcached_st *memc= memcached_create_with_options(config_string, strlen(config_string);
189 {
190 ...
191 }
192 memcached_free(memc);
193
194
195
196 ----
197 HOME
198 ----
199
200
201 To find out more information please check:
202 `https://launchpad.net/libmemcached <https://launchpad.net/libmemcached>`_
203
204
205
206 --------
207 SEE ALSO
208 --------
209
210
211 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`