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