1 .TH "MEMCACHED" "3" "May 23, 2011" "0.47" "libmemcached"
3 memcached \- libmemcached Documentation
5 .nr rst2man-indent-level 0
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17 .\" .rstReportMargin pre:
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31 .\" Man page generated from reStructeredText.
35 #include <libmemcached/memcached.h>
38 .B memcached_st *memcached(const char\fI\ *string\fP, size_t\fI\ string_length\fP)
42 .B memcached_return_t libmemcached_check_configuration(const char\fI\ *option_string\fP, size_t\fI\ length\fP, char\fI\ *error_buffer\fP, size_t\fI\ error_buffer_size\fP)
45 Compile and link with \-lmemcached
48 Libmemcached implements a custom language for configuring and modifying
49 servers. By passing in an option string you can generate a memcached_st object
50 that you can use in your application directly.
53 .B \-\-SERVER=<servername>:<optional_port>/?<optional_weight>
56 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.
62 Verify that keys that are being used fit within the design of the protocol being used.
65 .B \-\-REMOVE_FAILED_SERVERS
68 Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS.
71 .B \-\-BINARY\-PROTOCOL
74 Force all connections to use the binary protocol.
77 .B \-\-BUFFER\-REQUESTS
80 Enable MEMCACHED_BEHAVIOR_BUFFER_REQUESTS.
83 .B \-\-CONFIGURE\-FILE=
86 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.
89 .B \-\-CONNECT\-TIMEOUT=
92 Enable MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT.
98 Set the distribution model used by the client. See :manpage:\(ga\(ga for more details.
104 Set the hashing alogrthm used for placing keys on servers.
107 .B \-\-HASH\-WITH\-NAMESPACE
110 When enabled the prefix key will be added to the key when determining which
111 server to store the data in.
117 Enable "no reply" for all calls that support this. It is highly recommended
118 that you use this option with the binary protocol only.
121 .B \-\-NUMBER\-OF\-REPLICAS=
124 Set the nummber of servers that keys will be replicated to.
127 .B \-\-RANDOMIZE\-REPLICA\-READ
130 Select randomly the server within the replication pool to read from.
136 When adding new servers always calculate their distribution based on sorted naming order.
142 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_SUPPORT_CAS
148 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_USE_UDP
154 A namespace is a container that provides context for keys, only other
155 requests that know the namespace can access these values. This is
156 accomplished by prepending the namespace value to all keys.
157 .SS Mecached Pool Options:
163 Initial size of pool.
169 Maximize size of the pool.
176 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_TCP_NODELAY
179 .B \-\-TCP\-KEEPALIVE
182 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
185 .B \-\-RETRY\-TIMEOUT=
188 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
191 .B \-\-SERVER\-FAILURE\-LIMIT=
194 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
200 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_SND_TIMEOUT
203 .B \-\-SOCKET\-RECV\-SIZE=
206 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
209 .B \-\-SOCKET\-SEND\-SIZE=
212 See \fImemcached_behavior_set(3)\fP for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
215 .B \-\-POLL\-TIMEOUT=
218 That sets the value of the timeout used by :manpage: \fIpoll()\fP.
221 .B \-\-IO\-BYTES\-WATERMARK=
225 .B \-\-IO\-KEY\-PREFETCH=
229 .B \-\-IO\-MSG\-WATERMARK=
245 Include a file in configuration. Unlike \-\-CONFIGURE\-FILE= this will not reset memcached_st
251 Reset memcached_st and continue to process.
257 End configutation processing.
263 End configutation processing and throw an error.
266 memcached() returns a pointer to the memcached_st that was
267 created (or initialized). On an allocation failure, it returns NULL.
272 const char *config_string= "\-\-SERVER=host10.example.com \-\-SERVER=host11.example.com \-\-SERVER=host10.example.com"
273 memcached_st *memc= memcached(config_string, strlen(config_string);
277 memcached_free(memc);
282 To find out more information please check:
283 \fI\%http://libmemcached.org/\fP
286 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
290 2011, Brian Aker DataDifferential, http://datadifferential.com/
291 .\" Generated by docutils manpage writer.