Merge in all of build.
[awesomized/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
28 .. describe:: --SERVER=<servername>:<optional_port>/?<optional_weight>
29
30 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.
31
32 .. describe:: --VERIFY-KEY
33
34 Verify that keys that are being used fit within the design of the protocol being used.
35
36 .. describe:: --REMOVE_FAILED_SERVERS
37
38 Enable the behavior MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS.
39
40 .. describe:: --BINARY-PROTOCOL
41
42 Force all connections to use the binary protocol.
43
44 .. describe:: --BUFFER-REQUESTS
45
46 Enable MEMCACHED_BEHAVIOR_BUFFER_REQUESTS.
47
48 .. describe:: --CONFIGURE-FILE=
49
50 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.
51
52 .. describe:: --CONNECT-TIMEOUT=
53
54 Enable MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT.
55
56 .. describe:: --DISTRIBUTION=
57
58 Set the distribution model used by the client. See :manpage:`` for more details.
59
60 .. describe:: --HASH=
61
62 Set the hashing alogrthm used for placing keys on servers.
63
64 .. describe:: --HASH-WITH-PREFIX_KEY
65
66 .. describe:: --IO-BYTES-WATERMARK=
67
68 .. describe:: --IO-KEY-PREFETCH=
69
70 .. describe:: --IO-MSG-WATERMARK=
71
72 .. describe:: --NOREPLY
73
74 .. describe:: --NUMBER-OF-REPLICAS=
75
76 Set the nummber of servers that keys will be replicated to.
77
78 .. describe:: --POLL-TIMEOUT=
79
80 .. describe:: --RANDOMIZE-REPLICA-READ
81
82 Select randomly the server within the replication pool to read from.
83
84 .. describe:: --RCV-TIMEOUT=
85
86 .. describe:: --RETRY-TIMEOUT=
87
88 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
89
90 .. describe:: --SERVER-FAILURE-LIMIT=
91
92 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
93
94 .. describe:: --SND-TIMEOUT=
95
96 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SND_TIMEOUT
97
98 .. describe:: --SOCKET-RECV-SIZE=
99
100 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
101
102 .. describe:: --SOCKET-SEND-SIZE=
103
104 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
105
106 .. describe:: --SORT-HOSTS
107
108 When adding new servers always calculate their distribution based on sorted naming order.
109
110 .. describe:: --SUPPORT-CAS
111
112 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_SUPPORT_CAS
113
114 .. describe:: --TCP-NODELAY
115
116 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_NODELAY
117
118 .. describe:: --TCP-KEEPALIVE
119
120 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
121
122 .. describe:: --TCP-KEEPIDLE
123
124 .. describe:: --USE-UDP
125
126 See :manpage:`memcached_behavior_set(3)` for MEMCACHED_BEHAVIOR_USE_UDP
127
128 .. describe:: --PREFIX-KEY=
129
130 .. describe:: INCLUDE
131
132 Include a file in configuration. Unlike --CONFIGURE-FILE= this will not reset memcached_st
133
134 .. describe:: RESET
135
136 Reset memcached_st and continue to process.
137
138 .. describe:: END
139
140 End configutation processing.
141
142 .. describe:: ERROR
143
144 End configutation processing and throw an error.
145
146
147 ------
148 RETURN
149 ------
150
151
152 memcached_create_with_options() returns a pointer to the memcached_st that was
153 created (or initialized). On an allocation failure, it returns NULL.
154
155
156
157 -------
158 EXAMPLE
159 -------
160
161
162 .. code-block:: c
163
164 const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
165 memcached_st *memc= memcached_create_with_options(config_string, strlen(config_string);
166 {
167 ...
168 }
169 memcached_free(memc);
170
171
172
173 ----
174 HOME
175 ----
176
177
178 To find out more information please check:
179 `https://launchpad.net/libmemcached <https://launchpad.net/libmemcached>`_
180
181
182
183 --------
184 SEE ALSO
185 --------
186
187
188 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`