packages icon

Tar Archive: /hpux/Misc/libmemcached-0.46/libmemcached-0.46-hppa_32-11.23.depot.gz
Filename:    libmemcached/libmemcached-MAN/usr/local/share/man/man3/memcached_behavior_set.3
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.el \{\
.    de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "memcached_behavior_set.pop 3"
.TH memcached_behavior_set.pop 3 "2011-02-08" "" "memcached_behavior_set"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
memcached_behavior_get, memcached_behavior_set \- Manipulate behavior
.SH "LIBRARY"
.IX Header "LIBRARY"
C Client Library for memcached (libmemcached, \-lmemcached)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&  #include 
\&
\&  uint64_t
\&    memcached_behavior_get (memcached_st *ptr,
\&                            memcached_behavior flag);
\&
\&  memcached_return_t
\&    memcached_behavior_set (memcached_st *ptr,
\&                            memcached_behavior flag,
\&                            uint64_t data);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fIlibmemcached\fR\|(3) behavior can be modified by use \fImemcached_behavior_set()\fR.
Default behavior is the library strives to be quick and accurate. Some
behavior, while being faster, can also result in not entirely accurate
behavior (for instance, \fImemcached_set()\fR will always respond with
\&\f(CW\*(C`MEMCACHED_SUCCESS\*(C'\fR).
.PP
\&\fImemcached_behavior_get()\fR takes a behavior flag and returns whether or not
that behavior is currently enabled in the client.
.PP
\&\fImemcached_behavior_set()\fR changes the value of a particular option of the
client. It takes both a flag (listed below) and a value. For simple on or
off options you just need to pass in a value of 1. Calls to
\&\fImemcached_behavior_set()\fR will flush and reset all connections.
.IP "\s-1MEMCACHED_BEHAVIOR_USE_UDP\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_USE_UDP"
Causes \fIlibmemcached\fR\|(3) to use the \s-1UDP\s0 transport when communicating
with a memcached server. Not all I/O operations are supported
when this behavior is enababled. The following operations will return
\&\f(CW\*(C`MEMCACHED_NOT_SUPPORTED\*(C'\fR when executed with the \s-1MEMCACHED_BEHAVIOR_USE_UDP\s0
enabled: \fImemcached_version()\fR, \fImemcached_stat()\fR, \fImemcached_get()\fR,
\&\fImemcached_get_by_key()\fR, \fImemcached_mget()\fR, \fImemcached_mget_by_key()\fR,
\&\fImemcached_fetch()\fR, \fImemcached_fetch_result()\fR, \fImemcached_value_fetch()\fR.
.Sp
All other operations are supported but are executed in a 'fire\-and\-forget'
mode, in which once the client has executed the operation, no attempt
will be made to ensure the operation has been received and acted on by the
server.
.Sp
\&\fIlibmemcached\fR\|(3) does not allow \s-1TCP\s0 and \s-1UDP\s0 servers to be shared within
the same \fIlibmemached\fR\|(3) client 'instance'. An attempt to add a \s-1TCP\s0 server
when this behavior is enabled will result in a \f(CW\*(C`MEMCACHED_INVALID_HOST_PROTOCOL\*(C'\fR,
as will attempting to add a \s-1UDP\s0 server when this behavior has not been enabled.
.IP "\s-1MEMCACHED_BEHAVIOR_NO_BLOCK\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_NO_BLOCK"
Causes \fIlibmemcached\fR\|(3) to use asychronous \s-1IO\s0. This is the fastest transport
available for storage functions.
.IP "\s-1MEMCACHED_BEHAVIOR_SND_TIMEOUT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SND_TIMEOUT"
This sets the microsecond behavior of the socket against the \s-1SO_SNDTIMEO\s0 flag.
In cases where you cannot use non-blocking \s-1IO\s0 this will allow you to still have
timeouts on the sending of data.
.IP "\s-1MEMCACHED_BEHAVIOR_RCV_TIMEOUT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_RCV_TIMEOUT"
This sets the microsecond behavior of the socket against the \s-1SO_RCVTIMEO\s0 flag.
In cases where you cannot use non-blocking \s-1IO\s0 this will allow you to still have
timeouts on the reading of data.
.IP "\s-1MEMCACHED_BEHAVIOR_TCP_NODELAY\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_TCP_NODELAY"
Turns on the no-delay feature for connecting sockets (may be faster in some
environments).
.IP "\s-1MEMCACHED_BEHAVIOR_HASH\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_HASH"
Makes the default hashing algorithm for keys use \s-1MD5\s0. The value can be set
to either \s-1MEMCACHED_HASH_DEFAULT\s0, \s-1MEMCACHED_HASH_MD5\s0, \s-1MEMCACHED_HASH_CRC\s0, \s-1MEMCACHED_HASH_FNV1_64\s0, \s-1MEMCACHED_HASH_FNV1A_64\s0, \s-1MEMCACHED_HASH_FNV1_32\s0, \s-1MEMCACHED_HASH_FNV1A_32\s0, \s-1MEMCACHED_HASH_JENKINS\s0, \s-1MEMCACHED_HASH_HSIEH\s0, and \s-1MEMCACHED_HASH_MURMUR\s0.
Each hash has it's advantages and it's weaknesses. If you don't know or don't care, just go with the default.
Support for \s-1MEMCACHED_HASH_HSIEH\s0 is a compile time option that is disabled by default. To enable support for this hashing algorithm, configure and build libmemcached with the \-\-enable\-hash_hsieh.
.IP "\s-1MEMCACHED_BEHAVIOR_DISTRIBUTION\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_DISTRIBUTION"
Using this you can enable different means of distributing values to servers.
The default method is \s-1MEMCACHED_DISTRIBUTION_MODULA\s0. You can enable
consistent hashing by setting \s-1MEMCACHED_DISTRIBUTION_CONSISTENT\s0.
Consistent hashing delivers better distribution and allows servers to be
added to the cluster with minimal cache losses. Currently
\&\s-1MEMCACHED_DISTRIBUTION_CONSISTENT\s0 is an alias for the value
\&\s-1MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA\s0.
.IP "\s-1MEMCACHED_BEHAVIOR_CACHE_LOOKUPS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_CACHE_LOOKUPS"
Memcached can cache named lookups so that \s-1DNS\s0 lookups are made only once.
.IP "\s-1MEMCACHED_BEHAVIOR_SUPPORT_CAS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SUPPORT_CAS"
Support \s-1CAS\s0 operations (this is not enabled by default at this point in the server since it imposes a slight performance penalty).
.IP "\s-1MEMCACHED_BEHAVIOR_KETAMA\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KETAMA"
Sets the default distribution to \s-1MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA\s0
and the hash to \s-1MEMCACHED_HASH_MD5\s0.
.IP "\s-1MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED"
Sets the default distribution to \s-1MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA\s0 with the weighted support.
and the hash to \s-1MEMCACHED_HASH_MD5\s0.
.IP "\s-1MEMCACHED_BEHAVIOR_KETAMA_HASH\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KETAMA_HASH"
Sets the hashing algorithm for host mapping on continuum. The value can be set
to either \s-1MEMCACHED_HASH_DEFAULT\s0, \s-1MEMCACHED_HASH_MD5\s0, \s-1MEMCACHED_HASH_CRC\s0, \s-1MEMCACHED_HASH_FNV1_64\s0, \s-1MEMCACHED_HASH_FNV1A_64\s0, \s-1MEMCACHED_HASH_FNV1_32\s0, and \s-1MEMCACHED_HASH_FNV1A_32\s0.
.IP "\s-1MEMCACHED_BEHAVIOR_KETAMA_COMPAT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KETAMA_COMPAT"
Sets the compatibility mode. The value can be set to either
\&\s-1MEMCACHED_KETAMA_COMPAT_LIBMEMCACHED\s0 (this is the default) or
\&\s-1MEMCACHED_KETAMA_COMPAT_SPY\s0 to be compatible with the \s-1SPY\s0 Memcached client
for Java.
.IP "\s-1MEMCACHED_BEHAVIOR_POLL_TIMEOUT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_POLL_TIMEOUT"
Modify the timeout value that is used by \fIpoll()\fR. The default value is \-1. An signed int pointer must be passed to \fImemcached_behavior_set()\fR to change this value. For \fImemcached_behavior_get()\fR a signed int value will be cast and returned as the unsigned long long.
.IP "\s-1MEMCACHED_BEHAVIOR_USER_DATA\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_USER_DATA"
This allows you to store a pointer to a specifc piece of data. This can be
retrieved from inside of \fImemcached_fetch_execute()\fR. Cloning a memcached_st
.Sp
will copy the pointer to the clone. This was deprecated in 0.14 in favor
of \fImemcached_callback_set\fR\|(3). This will be removed in 0.15.
.IP "\s-1MEMCACHED_BEHAVIOR_BUFFER_REQUESTS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_BUFFER_REQUESTS"
Enabling buffered \s-1IO\s0 causes commands to \*(L"buffer\*(R" instead of being sent. Any
action that gets data causes this buffer to be be sent to the remote
connection. Quiting the connection or closing down the connection will also
cause the buffered data to be pushed to the remote connection.
.IP "\s-1MEMCACHED_BEHAVIOR_VERIFY_KEY\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_VERIFY_KEY"
Enabling this will cause \fIlibmemcached\fR\|(3) to test all keys to verify that they
are valid keys.
.IP "\s-1MEMCACHED_BEHAVIOR_SORT_HOSTS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SORT_HOSTS"
Enabling this will cause hosts that are added to be placed in the host list in
sorted order. This will defeat consisten hashing.
.IP "\s-1MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT"
In non-blocking mode this changes the value of the timeout during socket
connection.
.IP "\s-1MEMCACHED_BEHAVIOR_BINARY_PROTOCOL\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_BINARY_PROTOCOL"
Enable the use of the binary protocol. Please note that you cannot toggle
this flag on an open connection.
.IP "\s-1MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT"
Set this value to enable the server be removed after continuous \s-1MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT\s0
times connection failure.
.IP "\s-1MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK"
Set this value to tune the number of messages that may be sent before
libmemcached should start to automatically drain the input queue. Setting
this value to high, may cause libmemcached to deadlock (trying to send data,
but the send will block because the input buffer in the kernel is full).
.IP "\s-1MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK"
Set this value to tune the number of bytes that may be sent before
libmemcached should start to automatically drain the input queue (need
at least 10 \s-1IO\s0 requests sent without reading the input buffer). Setting
this value to high, may cause libmemcached to deadlock (trying to send
data, but the send will block because the input buffer in the kernel is full).
.IP "\s-1MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH"
The binary protocol works a bit different than the textual protocol in
that a multiget is implemented as a pipe of single get-operations which
are sent to the server in a chunk. If you are using large multigets from
your application, you may improve the latency of the gets by setting
this value so you send out the first chunk of requests when you hit the
specified limit.  It allows the servers to start processing the requests
to send the data back while the rest of the requests are created and
sent to the server.
.IP "\s-1MEMCACHED_BEHAVIOR_NOREPLY\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_NOREPLY"
Set this value to specify that you really don't care about the result
from your storage commands (set, add, replace, append, prepend).
.IP "\s-1MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS"
If you just want \*(L"a poor mans \s-1HA\s0\*(R", you may specify the numbers of
replicas libmemcached should store of each item (on different servers).
This replication does not dedicate certain memcached servers to store the
replicas in, but instead it will store the replicas together with all of the
other objects (on the 'n' next servers specified in your server list).
.IP "\s-1MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ"
Allows randomizing the replica reads starting point. Normally the read is
done from primary server and in case of miss the read is done from primary
+ 1, then primary + 2 all the way to 'n' replicas. If this option is set
on the starting point of the replica reads is randomized between the servers.
This allows distributing read load to multiple servers with the expense of
more write traffic.
.IP "\s-1MEMCACHED_BEHAVIOR_CORK\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_CORK"
Enable \s-1TCP_CORK\s0 behavior. This is only available as an option Linux.
\&\s-1MEMCACHED_NO_SERVERS\s0 is returned if no servers are available to test with.
\&\s-1MEMCACHED_NOT_SUPPORTED\s0 is returned if we were not able to determine
if support was available. All other responses then \s-1MEMCACHED_SUCCESS\s0
report an error of some sort. This behavior also enables
\&\s-1MEMCACHED_BEHAVIOR_TCP_NODELAY\s0 when set.
.IP "\s-1MEMCACHED_BEHAVIOR_KEEPALIVE\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KEEPALIVE"
Enable \s-1TCP_KEEPALIVE\s0 behavior.
.IP "\s-1MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE"
Specify time, in seconds, to mark a connection as idle. This is only available as an option Linux.
.IP "\s-1MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE"
Find the current size of \s-1SO_SNDBUF\s0. A value of 0 means either an error
occured or no hosts were available. It is safe to assume system default
if this occurs.
.IP "\s-1MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE"
Find the current size of \s-1SO_RCVBUF\s0. A value of 0 means either an error
occured or no hosts were available. It is safe to assume system default
if this occurs.
.IP "\s-1MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT"
This number of times a host can have an error before it is disabled.
.IP "\s-1MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS"
If enabled any hosts which have been flagged as disabled will be removed
from the list of servers in the memcached_st structure. This must be used
in combination with \s-1MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT\s0.
.IP "\s-1MEMCACHED_BEHAVIOR_RETRY_TIMEOUT\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_RETRY_TIMEOUT"
When enabled a host which is problematic will only be checked for usage
based on the amount of time set by this behavior.
.IP "\s-1MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY\s0" 4
.IX Item "MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY"
When enabled the prefix key will be added to the key when determining
server by hash.
.SH "RETURN"
.IX Header "RETURN"
\&\fImemcached_behavior_get()\fR returns either the current value of the get, or 0
or 1 on simple flag behaviors (1 being enabled). \fImemcached_behavior_set()\fR
returns failure or success.
.SH "NOTES"
.IX Header "NOTES"
\&\fImemcached_behavior_set()\fR in version .17 was changed from taking a pointer
to data value, to taking a uin64_t.
.SH "HOME"
.IX Header "HOME"
To find out more information please check:

.SH "AUTHOR"
.IX Header "AUTHOR"
Brian Aker, 
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fImemcached\fR\|(1) \fIlibmemcached\fR\|(3) \fImemcached_strerror\fR\|(3)