|
1 '\" te |
|
2 .TH memcached 8 "20 Oct 2015" "SunOS 5.12" "Administration Commands" |
|
3 .SH NAME |
|
4 memcached \- high performance memory object caching |
|
5 system |
|
6 .SH SYNOPSIS |
|
7 .LP |
|
8 .nf |
|
9 \fBmemcached [\fB-l\fR \fI<ip-addr>\fR] [\fB-d\fR] [\fB-u\fR \fI<username>\fR] |
|
10 [\fB-m\fR \fI<num>\fR] [\fB-c\fR \fI<num>\fR] [\fB-k\fR] [\fB-L \fR] |
|
11 [\fB-p\fR \fI<num>\fR] [\fB-U\fR \fI<num>\fR] [\fB-s\fR \fI<filename>\fR] |
|
12 [\fB-a\fR \fI<perms>\fR] [\fB-M\fR] [\fB-r\fR] [\fB-b\fR] |
|
13 [\fB-f\fR \fI<factor>\fR] [\fB-n\fR \fI<size>\fR] [\fB-h\fR] [\fB-v\fR] [\fB-vv\fR] [\fB-i\fR] |
|
14 [\fB-P\fR \fI<filename>\fR] [\fB-t\fR \fI<threads>\fR] [\fB-D\fR \fI<char>\fR]\fR |
|
15 .fi |
|
16 |
|
17 .SH DESCRIPTION |
|
18 .sp |
|
19 .LP |
|
20 \fBmemcached\fR is a flexible memory object caching daemon |
|
21 designed to alleviate database load in dynamic web applications by storing |
|
22 objects in memory. It is based on \fBlibevent\fR to scale to |
|
23 any size needed, and is specifically optimized to avoid swapping and always |
|
24 use non-blocking I/O. This man page documents briefly the \fBmemcached\fR memory |
|
25 object caching daemon. |
|
26 .SH OPTIONS |
|
27 .sp |
|
28 .LP |
|
29 The options supported by the \fBmemcached\fR command are |
|
30 described below. |
|
31 .sp |
|
32 .ne 2 |
|
33 .mk |
|
34 .na |
|
35 \fB\fB-l\fR \fI<ip-addr>\fR\fR |
|
36 .ad |
|
37 .RS 17n |
|
38 .rt |
|
39 Listen on \fI<ip-addr>\fR; default |
|
40 to \fBINADDR_ANY\fR. This is an important option to consider |
|
41 as there is no other way to secure the installation. Binding to an internal |
|
42 or fire walled network interface is suggested. |
|
43 .RE |
|
44 |
|
45 .sp |
|
46 .ne 2 |
|
47 .mk |
|
48 .na |
|
49 \fB\fB-d\fR\fR |
|
50 .ad |
|
51 .RS 17n |
|
52 .rt |
|
53 Run memcached as a daemon. |
|
54 .RE |
|
55 |
|
56 .sp |
|
57 .ne 2 |
|
58 .mk |
|
59 .na |
|
60 \fB\fB-u\fR \fI<username>\fR\fR |
|
61 .ad |
|
62 .RS 17n |
|
63 .rt |
|
64 Assume the identity of \fI<username>\fR only when run as a super user (root). |
|
65 .RE |
|
66 |
|
67 .sp |
|
68 .ne 2 |
|
69 .mk |
|
70 .na |
|
71 \fB\fB-m\fR \fI<num>\fR\fR |
|
72 .ad |
|
73 .RS 17n |
|
74 .rt |
|
75 Use the maximum \fI<num>\fR MB memory for object storage; the default is 64 MB. |
|
76 .RE |
|
77 |
|
78 .sp |
|
79 .ne 2 |
|
80 .mk |
|
81 .na |
|
82 \fB\fB-c\fR \fI<num>\fR\fR |
|
83 .ad |
|
84 .RS 17n |
|
85 .rt |
|
86 Use the specified number of maximum simultaneous connections; |
|
87 the default is 1024. |
|
88 .RE |
|
89 |
|
90 .sp |
|
91 .ne 2 |
|
92 .mk |
|
93 .na |
|
94 \fB\fB-k\fR\fR |
|
95 .ad |
|
96 .RS 17n |
|
97 .rt |
|
98 Lock down all paged memory. |
|
99 .sp |
|
100 Use this option with caution with large caches. For information about |
|
101 the configuration suggestions, see the README and the memcached home page. |
|
102 .RE |
|
103 |
|
104 .sp |
|
105 .ne 2 |
|
106 .mk |
|
107 .na |
|
108 \fB\fB-L\fR\fR |
|
109 .ad |
|
110 .RS 17n |
|
111 .rt |
|
112 Preallocate memory and use large memory pages if possible. |
|
113 .sp |
|
114 This option will preallocate cache memory for object storage. |
|
115 See description of \fB-m\fR option for a specification of the size of the memory. |
|
116 If supported by the platform, large memory pages will be allocated. |
|
117 This should reduce number of TLB misses and increase performance. |
|
118 .RE |
|
119 |
|
120 .sp |
|
121 .ne 2 |
|
122 .mk |
|
123 .na |
|
124 \fB\fB-p\fR \fI<num>\fR\fR |
|
125 .ad |
|
126 .RS 17n |
|
127 .rt |
|
128 Listen on the TCP port \fI<num>\fR\&. |
|
129 The default port is 11211. |
|
130 .RE |
|
131 |
|
132 .sp |
|
133 .ne 2 |
|
134 .mk |
|
135 .na |
|
136 \fB\fB-U\fR \fI<num>\fR\fR |
|
137 .ad |
|
138 .RS 17n |
|
139 .rt |
|
140 Listen on the UDP port \fI<num>\fR\&. |
|
141 The default is 0, meaning that the UDP protocol is disabled. |
|
142 .RE |
|
143 |
|
144 .sp |
|
145 .ne 2 |
|
146 .mk |
|
147 .na |
|
148 \fB\fB-s\fR \fI<filename>\fR\fR |
|
149 .ad |
|
150 .RS 17n |
|
151 .rt |
|
152 Unix socket path to listen on (disables listening support for TCP and UDP). |
|
153 .RE |
|
154 |
|
155 .sp |
|
156 .ne 2 |
|
157 .mk |
|
158 .na |
|
159 \fB\fB-a\fR \fI<perms>\fR\fR |
|
160 .ad |
|
161 .RS 17n |
|
162 .rt |
|
163 Permissions (in octal format) for Unix socket created with \fB-s\fR option. |
|
164 Default value is 0700. |
|
165 .RE |
|
166 |
|
167 .sp |
|
168 .ne 2 |
|
169 .mk |
|
170 .na |
|
171 \fB\fB-M\fR\fR |
|
172 .ad |
|
173 .RS 17n |
|
174 .rt |
|
175 Disable automatic removal of items from the cache when out |
|
176 of memory. Additions will not be possible until adequate space is freed up. |
|
177 .RE |
|
178 |
|
179 .sp |
|
180 .ne 2 |
|
181 .mk |
|
182 .na |
|
183 \fB\fB-r\fR\fR |
|
184 .ad |
|
185 .RS 17n |
|
186 .rt |
|
187 Raise the core file size limit to the maximum allowable. |
|
188 .RE |
|
189 |
|
190 .sp |
|
191 .ne 2 |
|
192 .mk |
|
193 .na |
|
194 \fB\fB-b\fR\fR |
|
195 .ad |
|
196 .RS 17n |
|
197 .rt |
|
198 Run a managed instance. |
|
199 .RE |
|
200 |
|
201 .sp |
|
202 .ne 2 |
|
203 .mk |
|
204 .na |
|
205 \fB\fB-f\fR \fI<factor>\fR\fR |
|
206 .ad |
|
207 .RS 17n |
|
208 .rt |
|
209 Use this option to specify \fI<factor>\fR as |
|
210 the multiplier for computing the sizes of memory chunks that items are stored |
|
211 in. A lower value may result in less wasted memory depending on the total |
|
212 amount of memory available and the distribution of item sizes. The default |
|
213 value is 1.25. |
|
214 .RE |
|
215 |
|
216 .sp |
|
217 .ne 2 |
|
218 .mk |
|
219 .na |
|
220 \fB\fB-n\fR \fI<size>\fR\fR |
|
221 .ad |
|
222 .RS 17n |
|
223 .rt |
|
224 Allocate a minimum of \fI<size>\fR bytes |
|
225 for the item key, value, and flags. The default value is 48. If you have a |
|
226 lot of small keys and values, you can get a significant memory efficiency |
|
227 gain with a lower value. If you use a high chunk growth factor, that is \fB-f\fR option, you may want to increase the size to allow a bigger percentage |
|
228 of your items to fit in the most densely packed smallest chunks. |
|
229 .RE |
|
230 |
|
231 .sp |
|
232 .ne 2 |
|
233 .mk |
|
234 .na |
|
235 \fB\fB-h\fR\fR |
|
236 .ad |
|
237 .RS 17n |
|
238 .rt |
|
239 Show the version of memcached and a summary of options. |
|
240 .RE |
|
241 |
|
242 .sp |
|
243 .ne 2 |
|
244 .mk |
|
245 .na |
|
246 \fB\fB-v\fR\fR |
|
247 .ad |
|
248 .RS 17n |
|
249 .rt |
|
250 Be verbose during the event loop; print out errors and warnings. |
|
251 .RE |
|
252 |
|
253 .sp |
|
254 .ne 2 |
|
255 .mk |
|
256 .na |
|
257 \fB\fB-vv\fR\fR |
|
258 .ad |
|
259 .RS 17n |
|
260 .rt |
|
261 Be even more verbose; same as \fB-v\fR option but |
|
262 also print client commands and responses. |
|
263 .RE |
|
264 |
|
265 .sp |
|
266 .ne 2 |
|
267 .mk |
|
268 .na |
|
269 \fB\fB-i\fR\fR |
|
270 .ad |
|
271 .RS 17n |
|
272 .rt |
|
273 Display \fBmemcached\fR and \fBlibevent\fR licenses. |
|
274 .RE |
|
275 |
|
276 .sp |
|
277 .ne 2 |
|
278 .mk |
|
279 .na |
|
280 \fB\fB-P\fR \fI<filename>\fR\fR |
|
281 .ad |
|
282 .RS 17n |
|
283 .rt |
|
284 Print \fBpidfile\fR to the specified file. |
|
285 .LP |
|
286 Note - |
|
287 .sp |
|
288 .RS 2 |
|
289 This option can be used only when \fBmechached\fR is |
|
290 run as a daemon (\fB-d\fR option). |
|
291 .RE |
|
292 .RE |
|
293 |
|
294 .sp |
|
295 .ne 2 |
|
296 .mk |
|
297 .na |
|
298 \fB\fB-t\fR \fI<threads>\fR\fR |
|
299 .ad |
|
300 .RS 17n |
|
301 .rt |
|
302 Number of threads to use to process incoming requests. The default is 4. |
|
303 It is typically not useful to set this much higher than the number of CPU cores |
|
304 on the \fBmemcached\fR server. |
|
305 .RE |
|
306 |
|
307 .sp |
|
308 .ne 2 |
|
309 .mk |
|
310 .na |
|
311 \fB\fB-D\fR \fI<char>\fR\fR |
|
312 .ad |
|
313 .RS 17n |
|
314 .rt |
|
315 Use the \fI<char>\fR as the delimiter |
|
316 between key prefixes and IDs. This is used for per-prefix statistics reporting. |
|
317 The default is \fB:\fR (colon). If this option is specified, |
|
318 statistics collection is turned on automatically; if not, then it can be turned |
|
319 on by sending the \fBstats detail on\fR command to the server. |
|
320 .RE |
|
321 |
|
322 .SH EXIT STATUS |
|
323 .sp |
|
324 .LP |
|
325 The following exit values are returned: |
|
326 .sp |
|
327 .ne 2 |
|
328 .mk |
|
329 .na |
|
330 \fB\fB0\fR\fR |
|
331 .ad |
|
332 .RS 5n |
|
333 .rt |
|
334 command executed successfully |
|
335 .RE |
|
336 |
|
337 .sp |
|
338 .ne 2 |
|
339 .mk |
|
340 .na |
|
341 \fB\fB1\fR\fR |
|
342 .ad |
|
343 .RS 5n |
|
344 .rt |
|
345 error in executing the command |
|
346 .RE |
|
347 |
|
348 .SH SERVICE MANAGEMENT FACILITY |
|
349 .sp |
|
350 .LP |
|
351 \fBmemcached\fR package for Solaris (\fBservice/memcached\fR) |
|
352 includes files necessary to register with the Service Management Facility |
|
353 described in \fISMF(7)\fR. The following procedure describes the steps to automate |
|
354 the service management using memcached. |
|
355 .RS +4 |
|
356 .TP |
|
357 1. |
|
358 Add other parameters to be passed to the memcached service instance. |
|
359 .sp |
|
360 example: specify the server to use 1024 MB of memory |
|
361 .sp |
|
362 .in +2 |
|
363 .nf |
|
364 example% svccfg |
|
365 svc:> select memcached |
|
366 svc:/application/database/memcached> setprop memcached/options=("-m" "1024") |
|
367 svc:/application/database/memcached> quit |
|
368 example% svcadm refresh memcached |
|
369 .fi |
|
370 .in -2 |
|
371 |
|
372 .LP |
|
373 Note - |
|
374 .sp |
|
375 .RS 2 |
|
376 The arguments cannot be passed as a single string because of a limitation in \fIsvccfg\fR. |
|
377 .RE |
|
378 .RE |
|
379 .RS +4 |
|
380 .TP |
|
381 2. |
|
382 Enable memcached . |
|
383 .sp |
|
384 .in +2 |
|
385 .nf |
|
386 example% svcadm enable memcached |
|
387 .fi |
|
388 .in -2 |
|
389 |
|
390 The state of the service instance changes to \fBonline\fR, |
|
391 and the memcached service instance must be started: |
|
392 .sp |
|
393 .in +2 |
|
394 .nf |
|
395 example% svcs memcached |
|
396 STATE STIME FMRI |
|
397 online 1:19:15 svc:/application/database/memcached:default |
|
398 .fi |
|
399 .in -2 |
|
400 .sp |
|
401 |
|
402 .RE |
|
403 .RS +4 |
|
404 .TP |
|
405 3. |
|
406 To disable shutdown and automatic restart of memcached service instance, |
|
407 .sp |
|
408 .in +2 |
|
409 .nf |
|
410 example% svcadm disable memcached |
|
411 .fi |
|
412 .in -2 |
|
413 |
|
414 .RE |
|
415 .SH USER AUTHORIZATIONS |
|
416 .sp |
|
417 .LP |
|
418 You can use \fBRBAC(7)\fR to authorize otherwise non-privileged users to manage |
|
419 \fBmemcached\fR services. |
|
420 To let a user named \fBmyuser\fR change \fBmemcached\fR value properties and |
|
421 manage \fBmemcached\fR service states, add the following line to |
|
422 \fB/etc/user_attr\fR: |
|
423 .sp |
|
424 .in +2 |
|
425 .nf |
|
426 myuser::::type=role;profiles=Memcached Administration,All |
|
427 .fi |
|
428 .in -2 |
|
429 .sp |
|
430 .RE |
|
431 .SH PACKAGE CONTENTS |
|
432 .sp |
|
433 .LP |
|
434 The \fBmemcached\fR package consists of the memcached server and |
|
435 man pages for the server. |
|
436 .sp |
|
437 .LP |
|
438 Client libraries can be made available by installing other packages. |
|
439 .sp |
|
440 .LP |
|
441 The memcached server is based on the memcached open-source software |
|
442 available from http://www.danga.com/memcached/\&. |
|
443 .SH SECURITY |
|
444 .sp |
|
445 .LP |
|
446 When the memcached server is started, it listens for network requests |
|
447 on a TCP port and/or a UDP port. It is important for the security of the network |
|
448 that you protect this port, for example, by blocking access to this port in |
|
449 a firewall. |
|
450 .sp |
|
451 .LP |
|
452 The default TCP port number to use is 11211. |
|
453 .sp |
|
454 .LP |
|
455 You may use the \fB-p\fR option to set another TCP port number. |
|
456 There is no default UDP port number. You can use the \fB-U\fR option |
|
457 to set a UDP port number. |
|
458 .sp |
|
459 .LP |
|
460 If you are running memcached on a server with multiple network interfaces, |
|
461 you can restrict vulnerability by binding memcached to a single interface |
|
462 by using the \fB-l\fR option. |
|
463 .LP |
|
464 Caution - |
|
465 .sp |
|
466 .RS 2 |
|
467 Note that \fBmemcached\fR was designed for speed |
|
468 and not for security. There is no authentication of requests that go in to |
|
469 the memcached servers, and communication is not encrypted. The network that |
|
470 your memcached servers and clients run within should be safe-guarded against |
|
471 network attacks. |
|
472 .RE |
|
473 .SH SEE ALSO |
|
474 .sp |
|
475 .LP |
|
476 \fBlibmemcached(3libmemcached)\fR |
|
477 .LP |
|
478 Additional documentation (FAQ) can be found at http://www.eu.socialtext.net/memcached/index.cgi\&. |
|
479 .SH NOTES |
|
480 .sp |
|
481 .LP |
|
482 LICENSE |
|
483 .sp |
|
484 .LP |
|
485 The \fBmemcached\fR daemon is copyright Danga Interactive |
|
486 and is distributed under the BSD license. \fBmemcached\fR clients |
|
487 are licensed separately. |