memaslap - Load testing and benchmarking a server
==================================================
-
---------
SYNOPSIS
--------
.. envvar:: MEMCACHED_SERVERS
------------
DESCRIPTION
-----------
-
:program:`memaslap` is a load generation and benchmark tool for memcached
servers. It generates configurable workload such as threads, concurrency,
connections, run time, overwrite, miss rate, key size, value size, get/set
You can specify servers via the :option:`memslap --servers` option or via the
environment variable :envvar:`MEMCACHED_SERVERS`.
-
---------
FEATURES
--------
-
Memslap is developed to for the following purposes:
-
Manages network connections with libevent asynchronously.
-
-
Set both TCP and UDP up to use non-blocking IO.
-
-
Improves parallelism: higher performance in multi-threads environments.
-
-
Improves time efficiency: faster processing speed.
-
-
Generates key and value more efficiently; key size distribution and value size distribution are configurable.
-
-
Supports get, multi-get, and set commands; command distribution is configurable.
-
-
Supports controllable miss rate and overwrite rate.
-
-
Supports data and expire-time verification.
-
-
Supports dumping statistic information periodically.
-
-
Supports thousands of TCP connections.
-
-
Supports binary protocol.
-
-
Supports facebook test (set with TCP and multi-get with UDP) and replication test.
-
-
-
--------
DETAILS
-------
-
Effective implementation of network.
____________________________________
-
For memaslap, both TCP and UDP use non-blocking network IO. All
the network events are managed by libevent as memcached. The network module
of memaslap is similar to memcached. Libevent can ensure
memaslap can handle network very efficiently.
-
Effective implementation of multi-threads and concurrency
_________________________________________________________
-
Memslap has the similar implementation of multi-threads to
memcached. Memslap creates one or more self-governed threads;
each thread is bound with one CPU core if the system tests setting CPU
concurrency and socket connections of each concurrency according to their
expected workload.
-
Effective implementation of generating key and value
____________________________________________________
-
-In order to improve time efficiency and space efficiency,
+In order to improve time efficiency and space efficiency,
memaslap creates a random characters table with 10M characters. All the
suffixes of keys and values are generated from this random characters table.
time, each concurrency kicks objects out of its window and adds new object
into it.
-
Simple but useful task scheduling
_________________________________
-
Memslap uses libevent to schedule all concurrent tasks of
threads, and each concurrency schedules tasks based on the local task
window. Memslap assumes that if each concurrency keeps the same
specify the window size to get the expected miss rate of the first cache
layer.
-
Useful implementation of multi-servers , UDP, TCP, multi-get and binary protocol
________________________________________________________________________________
-
Because each thread is self-governed, memaslap can assign
different threads to handle different memcached servers. This is just one of
the ways in which memaslap tests multiple servers. The only
get lost, the waiting timeout mechanism can ensure half-baked packages will
be discarded and the next command will be sent.
-
-
------
USAGE
-----
-
Below are some usage samples:
-
memaslap -s 127.0.0.1:11211 -S 5s
-
-
memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k
-
-
memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40
-
-
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m
-
-
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
-
-
The user must specify one server at least to run memaslap. The
rest of the parameters have default values, as shown below:
Facebook test = false Replication test = false
-
Key size, value size and command distribution.
______________________________________________
-
All the distributions are read from the configuration file specified by user
with "—cfg_cmd" option. If the user does not specify a configuration file,
memaslap will run with the default distribution (key size = 64,
testss 100% set and 100% get. For 100% get, it will preset some objects to
the server.
-
Multi-thread and concurrency
____________________________
-
The high performance of memaslap benefits from the special
schedule of thread and concurrency. It's important to specify the proper
number of them. The default number of threads is 1; the default number of
the throughput equal to or less than the maximum
throughput using "--tps" option.
-
Window size
___________
-
Most of the time, the user does not need to specify the window size. The
default window size is 10k. For Schooner Memcached, the user can specify
different window sizes to get different cache miss rates based on the test
cache_size / concurrency / (key_size + value_size) \* 0.7
-
Verification
____________
-
Memslap testss both data verification and expire-time
verification. The user can use "--verify=" or "-v" to specify the proportion
of data verification. In theory, it testss 100% data verification. The
verification. Specify the "--verbose" options to get more detailed error
information.
-For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
+For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
set with expire-time, 10% of the objects gotten will be verified. If the
objects are gotten, memaslap will verify the expire-time and
value.
-
multi-servers and multi-config
_______________________________
-
Memslap testss multi-servers based on self-governed thread.
There is a limitation that the number of servers cannot be greater than the
number of threads. Memslap assigns one thread to handle one
All the threads and concurrencies in memaslap are self-governed.
-So is memaslap. The user can start up several
+So is memaslap. The user can start up several
memaslap instances. The user can run memaslap on different client
machines to communicate with the same memcached server at the same. It is
recommended that the user start different memaslap on different
machines using the same configuration.
-
Run with execute number mode or time mode
_________________________________________
-
The default memaslap runs with time mode. The default run time
is 10 minutes. If it times out, memaslap will exit. Do not
specify both execute number mode and time mode at the same time; just
--execute_number=100000 (It means that after running 100000 commands, the test will exit.)
-
Dump statistic information periodically.
________________________________________
-
The user can use "--stat_freq=" or "-S" to specify the frequency.
For example:
For more information on the format of dumping statistic information, refer to "Format of Output" section.
-
Multi-get
_________
-
The user can use "--division=" or "-d" to specify multi-get keys count.
Memslap by default does single get with TCP. Memslap also testss data
verification and expire-time verification for multi-get.
binary protocol, memaslap sends several single get commands
together as "multi-get" to the server.
-
UDP and TCP
___________
-
Memslap testss both UDP and TCP. For TCP,
memaslap does not reconnect the memcached server if socket connections are
lost. If all the socket connections are lost or memcached server crashes,
UDP doesn't tests reconnection.
-
Facebook test
_____________
-
Set data with TCP and multi-get with UDP. Specify the following options:
"--facebook --division=50"
If you specify "--division=50", the key size must be less that 25 bytes
because the UDP packet size is 1400 bytes.
-
Replication test
________________
-
For replication test, the user must specify at least two memcached servers.
The user can use "—rep_write=" option to enable feature.
back to life again, memaslap will reconnect server 0. If both
server 0 and server 1 crash, memaslap will exit.
-
Supports thousands of TCP connections
_____________________________________
-
Start memaslap with "--conn_sock=" or "-n" to enable this
feature. Make sure that your system can tests opening thousands of files
and creating thousands of sockets. However, this feature does not tests
connections, and the total number of TCP socket connections is 128 \* 128 =
16384.
-
Supports binary protocol
________________________
-
Start memaslap with "--binary" or "-B" options to enable this
feature. It testss all the above features except UDP, because the latest
memcached 1.3.3 does not implement binary UDP protocol.
multi-get. If you specify "--division=50" option, it just sends 50 get
commands together as "multi-get" to the server.
-
-
-------------------
Configuration file
------------------
-
This section describes the format of the configuration file. By default
when no configuration file is specified memaslap reads the default
one located at ~/.memaslap.cnf.
Below is a sample configuration file:
-
.. code-block:: perl
---------------------------------------------------------------------------
0 0.1
1.0 0.9
-
-
-----------------
Format of output
----------------
-
At the beginning, memaslap displays some configuration information as follows:
-
servers : 127.0.0.1:11211
-
-
threads count: 1
-
-
concurrency: 16
-
-
run time: 20s
-
-
windows size: 10k
-
-
set proportion: set_prop=0.10
-
-
get proportion: get_prop=0.90
-
-
Where
_____
-
-
servers : "servers"
The servers used by memaslap.
The output of dynamic statistics is something like this:
-
.. code-block:: perl
---------------------------------------------------------------------------------------------------------------------------------
117.93 195.60
---------------------------------------------------------------------------------------------------------------------------------
-
-
Where
_____
-
-
Get Statistics
Statistics information of get command
At the end, memaslap will output something like this:
-
.. code-block:: perl
---------------------------------------------------------------------------------------------------------------------------------
Where
_____
-
-
Get Statistics
Get statistics of response time
--------
OPTIONS
-------
-
-s, --servers=
List one or more servers to connect. Servers count must be less than
threads count. e.g.: --servers=localhost:1234,localhost:11211
The proportion of objects need overwrite, e.g.: --overwrite=0.01.
Default never overwrite object.
--R, --reconnect
+-R, --reconnect
Reconnect tests, when connection is closed it will be reconnected.
--U, --udp
+-U, --udp
UDP tests, default memaslap uses TCP, TCP port and UDP port of
server must be same.
--a, --facebook
+-a, --facebook
Whether it enables facebook test feature, set with TCP and multi-get with UDP.
--B, --binary
+-B, --binary
Whether it enables binary protocol. Default with ASCII protocol.
-P, --tps=
-p, --rep_write=
The first nth servers can write data, e.g.: --rep_write=2.
--b, --verbose
+-b, --verbose
Whether it outputs detailed information when verification fails.
--h, --help
+-h, --help
Display this message and then exit.
--V, --version
+-V, --version
Display the version of the application and then exit.
-
---------
EXAMPLES
--------
-
memaslap -s 127.0.0.1:11211 -S 5s
memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
---------
SEE ALSO
--------
memcapable - Checking a Memcached server capabilities and compatibility
=======================================================================
---------
SYNOPSIS
--------
.. program:: memcapable
------------
DESCRIPTION
-----------
determine its capabilities by running the various commands and verifying
the response.
-
------------
LIMITATIONS
-----------
-
The current version of memcapable will only verify the binary protocol.
-
--------
OPTIONS
-------
-
.. option:: -h hostname
-
+
Specify the hostname to connect to. The default is \ *localhost*\
.. option:: -p port
-
+
Specify the port number to connect to. The default is \ *11211*\
-
+
.. option:: -c
-
+
Generate a coredump when it detects an error from the server.
-
+
.. option:: -v
-
+
Print out the comparison when it detects an error from the server.
-
+
.. option:: -t n
-
+
Set the timeout from an IO operation to/from the server to \ *n*\ seconds.
---------
SEE ALSO
--------
memcat - "cat" data from a server
=================================
-
-
---------
SYNOPSIS
--------
Copy a set of keys to stdout
-
.. program:: memcat
-
------------
DESCRIPTION
-----------
-
:program:`memcat` outputs to stdout the value a single or multiple set of keys
stored in a memcached(1) server. If any key is not found an error is returned.
It is similar to the standard UNIX cat(1) utility.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
---------
SEE ALSO
--------
memcp - Copy data to a server
=============================
-
Copies files to a collection of memcached servers
-
---------
SYNOPSIS
--------
.. program:: memcp
-
------------
DESCRIPTION
-----------
-
:program:`memcp` copies one or more files into memcached(1) servers.
It is similar to the standard UNIX cp(1) command.
The key names will be the names of the files,
without any directory path.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
-
---------
SEE ALSO
--------
memdump - Dumping your server
=============================
-
Dump a list of keys from a server.
-
---------
SYNOPSIS
--------
.. program:: memdump
------------
DESCRIPTION
-----------
-
-:program:`memdump` dumps a list of "keys" from all servers that
+:program:`memdump` dumps a list of "keys" from all servers that
it is told to fetch from. Because memcached does not guarantee to
provide all keys it is not possible to get a complete "dump".
-
--------
OPTIONS
-------
-
For a full list of operations run the tool with option:
.. option:: --help
-
-
---------
SEE ALSO
--------
memerror - translate an error code to a string
==============================================
-
Translates a memcached error code into a string
-
---------
SYNOPSIS
--------
.. program:: memerror
------------
DESCRIPTION
-----------
-
:program:`memerror` translates an error code from libmemcached(3) into a human
readable string.
-
--------
OPTIONS
-------
-
For a full list of operations run the tool with option:
.. option:: --help
-
-
---------
SEE ALSO
--------
memexist - Check for the existence of a key
===========================================
-
---------
SYNOPSIS
--------
.. program:: memexist
-
------------
DESCRIPTION
-----------
:program:`memexist` checks for the existance of a key within a cluster.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
---------
SEE ALSO
--------
memflush - flush all data from a server
=======================================
-
Reset a server or list of servers
-
---------
SYNOPSIS
--------
.. program:: memflush
------------
DESCRIPTION
-----------
-
:program:`memflush` resets the contents of memcached(1) servers.
This means that all data in the specified servers will be deleted.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
-
---------
SEE ALSO
--------
memparse - Parse an option string
=================================
-
Used to validate an option string
-
---------
SYNOPSIS
--------
.. program:: memparse
-
------------
DESCRIPTION
-----------
-
:program:`memparse` can be used to validate an option string.
--------
OPTIONS
-------
.. option:: --help
-
-
---------
SEE ALSO
--------
memping - Test to see if a server is available.
===============================================
-
---------
SYNOPSIS
--------
.. program:: memping
-
------------
DESCRIPTION
-----------
-
:program:`memping` can be used to ping a memcached server to see if it is taking connections.
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
---------
SEE ALSO
--------
memrm - Remove data from a server
=================================
-
memrm - Remove a key(s) from a collection of memcached servers
-
---------
SYNOPSIS
--------
.. program:: memrm
-
------------
DESCRIPTION
-----------
-
:program:`memrm` removes items, specified by key, from memcached(1) servers.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
-
-
---------
SEE ALSO
--------
memslap - Load testing and benchmarking a server
=================================================
-
---------
SYNOPSIS
--------
.. program:: memslap
------------
DESCRIPTION
-----------
-
:program:`memslap` is a load generation and benchmark tool for memcached(1)
servers. It generates configurable workload such as threads, concurrencies, connections, run time, overwrite, miss rate, key size, value size, get/set proportion, expected throughput, and so on.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
-.. option:: --servers
+.. option:: --servers
or via the environment variable:
.. option:: --help
-
-
---------
SEE ALSO
--------
memstat - Gather statistics from a server
=========================================
-
memstat - Display the operating status of a single or group of memcached servers
-
---------
SYNOPSIS
--------
.. program:: memstat
------------
DESCRIPTION
-----------
-
:program:`memstat` dumps the state of memcached(1) servers.
It displays all data to stdout.
-
--------
OPTIONS
-------
-
You can specify servers via the option:
-.. option:: --servers
+.. option:: --servers
or via the environment variable:
.. option:: --help
-.. option:: --analyze
+.. option:: --analyze
-
---------
SEE ALSO
--------
memtouch - Touches a key.
=========================
-
---------
SYNOPSIS
--------
.. program:: memtouch
-
------------
DESCRIPTION
-----------
-
:program:`memtouch` does a "touch" on the specified key.
--------
OPTIONS
-------
-
You can specify servers via the option:
.. option:: --servers
.. option:: --help
-
-
---------
SEE ALSO
--------
libmemcached/index
libmemcached/index_misc
-
.. toctree::
:titlesonly:
:caption: libmemcachedutil
The :func:`hashkit_free` frees any resources being consumed by the hashkit
objects that were initialized with :func:`hashkit_create` or :func:`hashkit_clone`.
-The :func:`hashkit_is_allocated` reports where the memory was allocated
+The :func:`hashkit_is_allocated` reports where the memory was allocated
for a hashkit object.
RETURN VALUE
------------
-:func:`hashkit_create` and :func:`hashkit_clone` will return NULL on
+:func:`hashkit_create` and :func:`hashkit_clone` will return NULL on
failure or non-NULL on success.
:func:`hashkit_is_allocated` returns true if the memory for the hashkit
These functions are used to set and retrieve the key and distribution hash functions.
-
RETURN VALUE
------------
particular server. All clients understand how this hashing works, so it is
possibly to reliably both push data to a server and retrieve data from a server.
-Group keys can be optionally used to group sets of objects with servers.
+Group keys can be optionally used to group sets of objects with servers.
Namespaces are supported, and can be used to partition caches so that multiple
applications can use the same memcached servers.
* :doc:`libhashkit`
* :doc:`libmemcachedutil`
-
SEE ALSO
--------
collection of servers) for their current state. Queries to find state return a
:type:`memcached_analysis_st` structure. You are responsible for freeing this structure.
-:func:`memcached_analyze` analyzes useful information based on the
+:func:`memcached_analyze` analyzes useful information based on the
provided servers and sets the result to the :type:`memcached_analysis_st`
structure. The return value must be freed by the calling application.
-A command line tool, :program:`memstat` with the option :option:`memstat --analyze`,
+A command line tool, :program:`memstat` with the option :option:`memstat --analyze`,
is provided so that you do not have to write an application to use this method.
------
RETURN
------
-A pointer to the allocated :type:`memcached_analysis_st` structure on
+A pointer to the allocated :type:`memcached_analysis_st` structure on
success and a NULL pointer on failure. You may inspect the error detail by
checking the :type:`memcached_return_t` value.
Appending or Prepending to data on the server
-
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_prepend(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
.. function:: memcached_return_t memcached_append(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
-:func:`memcached_prepend` and memcached_append are used to
+:func:`memcached_prepend` and memcached_append are used to
modify information on a server. All methods take a key, and its length to
store the object. Keys are currently limited to 250 characters when using
either a version of memcached which is 1.4 or below, or when using the text
alongside of the main value. Many sub libraries make use of this field,
so in most cases users should avoid making use of it.
-:func:`memcached_prepend` places a segment of data before the last piece
+:func:`memcached_prepend` places a segment of data before the last piece
of data stored. Currently expiration and key are not used in the server.
-:func:`memcached_append` places a segment of data at the end of the last
+:func:`memcached_append` places a segment of data at the end of the last
piece of data stored. Currently expiration and key are not used in the server.
-:func:`memcached_prepend_by_key` and
+:func:`memcached_prepend_by_key` and
:func:`memcached_append_by_key` methods both behave in a similar
method as the non key methods. The difference is that they use their
group_key parameter to map objects to particular servers.
and value. If the total size of the command, including overhead, exceeds
1400 bytes, a `MEMCACHED_WRITE_FAILURE` will be returned.
-
------
RETURN
------
-
All methods return a value of type :type:`memcached_return_t`.
On success the value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
string.
-
--------
SEE ALSO
--------
.. only:: man
- :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_set(3)` :manpage:`memcached_add(3)` :manpage:`memcached_cas(3)` :manpage:`memcached_replace(3)`
+:manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)` :manpage:`memcached_set(3)` :manpage:`memcached_add(3)` :manpage:`memcached_cas(3)` :manpage:`memcached_replace(3)`
--------
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_increment (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
.. function:: memcached_return_t memcached_decrement (memcached_st *ptr, const char *key, size_t key_length, uint32_t offset, uint64_t *value)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
:manpage:`memcached(1)` servers have the ability to increment and decrement keys
(overflow and underflow are not detected). This gives you the ability to use
memcached to generate shared sequences of values.
:func:`memcached_increment_with_initial_by_key`, and
:func:`memcached_decrement_with_initial_by_key` are master key equivalents of the above.
-
------
RETURN
------
On success that value will be `MEMCACHED_SUCCESS`.
Use memcached_strerror to translate this value to a printable string.
-
--------
SEE ALSO
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
.. function:: memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-:func:`memcached_cas` overwrites data in the server as long as the "cas"
+:func:`memcached_cas` overwrites data in the server as long as the "cas"
value is still the same in the server. You can get the cas value of a result
by calling :func:`memcached_result_cas` on a memcached_result_st(3)
structure. At the point that this note was written cas is still buggy in memcached.
Turning on tests for it in libmemcached(3) is optional. Please see
:func:`memcached_set` for information on how to do this.
-:func:`memcached_cas_by_key` method behaves in a similar method as the non
+:func:`memcached_cas_by_key` method behaves in a similar method as the non
key methods. The difference is that it uses the group_key parameter
to map objects to particular servers.
split among the key, key_prefix, and value; for cas ASCII operations there
are at least 1318 bytes available to split among the key, key_prefix and value. If the total size of the command, including overhead, exceeds 1400 bytes, a `MEMCACHED_WRITE_FAILURE` will be returned.
-
------
RETURN
------
-
All methods return a value of type :type:`memcached_return_t`.
On success the value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
string.
-
--------
SEE ALSO
--------
.. type:: memcached_st
.. function:: memcached_st* memcached_create(memcached_st *ptr)
-
+
.. function:: void memcached_free(memcached_st *ptr)
-
+
.. function:: memcached_st* memcached_clone(memcached_st *destination, memcached_st *source)
-
+
.. function:: void memcached_servers_reset(memcached_st)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-:func:`memcached_create` is used to create a :type:`memcached_st`
+:func:`memcached_create` is used to create a :type:`memcached_st`
structure that will then be used by other libmemcached(3) functions to
communicate with the server. You should either pass a statically declared
:type:`memcached_st` to :func:`memcached_create` or
a NULL. If a NULL passed in then a structure is allocated for you.
-Please note, when you write new application use
+Please note, when you write new application use
:func:`memcached` over :func:`memcached_create`.
-:func:`memcached_clone` is similar to :func:`memcached_create` but
+:func:`memcached_clone` is similar to :func:`memcached_create` but
it copies the defaults and list of servers from the source
:type:`memcached_st`. If you pass a null as the argument for the source
to clone, it is the same as a call to :func:`memcached_create`.
If the destination argument is NULL a :type:`memcached_st` will be allocated
for you.
-:func:`memcached_servers_reset` allows you to zero out the list of
+:func:`memcached_servers_reset` allows you to zero out the list of
servers that the :type:`memcached_st` has.
-To clean up memory associated with a :type:`memcached_st` structure you
+To clean up memory associated with a :type:`memcached_st` structure you
should pass it to :func:`memcached_free` when you are finished using it.
:func:`memcached_free` is the only way to make sure all memory is
deallocated when you finish using the structure.
RETURN
------
-
-:func:`memcached_create` returns a pointer to the :type:`memcached_st`
+:func:`memcached_create` returns a pointer to the :type:`memcached_st`
that was created (or initialized). On an allocation failure, it returns NULL.
-:func:`memcached_clone` returns a pointer to the :type:`memcached_st`
+:func:`memcached_clone` returns a pointer to the :type:`memcached_st`
that was created (or initialized). On an allocation failure, it returns NULL.
-
--------
SEE ALSO
--------
-===========================
Deleting data from a server
===========================
.. index:: object: memcached_st
---------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_delete (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
.. function:: memcached_return_t memcached_delete_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
Compile and link with -lmemcached
------------
DESCRIPTION
-----------
-
-:func:`memcached_delete` is used to delete a particular key.
+:func:`memcached_delete` is used to delete a particular key.
:func:`memcached_delete_by_key` works the same, but it takes a master key
to find the given value.
Please note the the memcached server removed tests for expiration in
the 1.4 version.
-
-------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned
On success that value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
If you are using the non-blocking mode of the library, success only
means that the message was queued for delivery.
-
-
---------
SEE ALSO
--------
Dumping data from a server
==========================
-
Get a list of keys found on memcached servers
.. index:: object: memcached_st
-
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
.. function:: memcached_return_t memcached_dump (memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks)
-
+
.. type:: memcached_return_t (*memcached_dump_fn)(memcached_st *ptr, const char *key, size_t key_length, void *context)
Compile and link with -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
-:func:`memcached_dump` is used to get a list of keys found in memcached(1)
+:func:`memcached_dump` is used to get a list of keys found in memcached(1)
servers. Because memcached(1) does not guarantee to dump all keys you can not
assume you have fetched all keys from the server. The function takes an array
of callbacks that it will use to execute on keys as they are found.
Currently the binary protocol is not tested.
-
-------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned
On success that value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
string.
-
-
--------
SEE ALSO
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_exist(memcached_st *ptr, char *key, size_t *key_length)
.. function:: memcached_return_t memcached_exist_by_key(memcached_st *ptr, char *group_key, size_t *group_key_length, char *key, size_t *key_length)
.. versionadded:: 0.53
-
-----------
DESCRIPTION
-----------
:func:`memcached_exist()` can be used to check if a key exists.
-
------
RETURN
------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
.. deprecated:: 0.50
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-:func:`memcached_fetch` is used to fetch an individual value from the server. :func:`memcached_mget` must always be called before using this method.
+:func:`memcached_fetch` is used to fetch an individual value from the server. :func:`memcached_mget` must always be called before using this method.
You must pass in a key and its length to fetch the object. You must supply
three pointer variables which will give you the state of the returned
object. A :type:`uint32_t` pointer to contain whatever flags you stored with the value, a :type:`size_t` pointer which will be filled with size of of the
object, and a :type:`memcached_return_t` pointer to hold any error. The
object will be returned upon success and NULL will be returned on failure. `MEMCACHED_END` is returned by the \*error value when all objects that have been found are returned. The final value upon `MEMCACHED_END` is null.
-Values returned by :func:`memcached_fetch` must be freed by the caller.
+Values returned by :func:`memcached_fetch` must be freed by the caller.
-All of the above functions are not tested when the
+All of the above functions are not tested when the
`MEMCACHED_BEHAVIOR_USE_UDP` has been set. Executing any of these
functions with this behavior on will result in `MEMCACHED_NOT_SUPPORTED` being returned, or for those functions which do not return a :type:`memcached_return_t`, the error function parameter will be set to `MEMCACHED_NOT_SUPPORTED`.
-
------
RETURN
------
-:func:`memcached_fetch` sets error to
+:func:`memcached_fetch` sets error to
to `MEMCACHED_END` upon successful conclusion.
`MEMCACHED_NOTFOUND` will be return if no keys at all were found.
and the key was set larger then `MEMCACHED_MAX_KEY`, which was the largest
key allowed for the original memcached ascii server.
-
--------
SEE ALSO
--------
Wipe contents of memcached servers
-
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_flush (memcached_st *ptr, time_t expiration)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
:func::`memcached_flush` is used to wipe clean the contents of :program:`memcached` servers.
It will either do this immediately or expire the content based on the
expiration time passed to the method (a value of zero causes an immediate
single server. That is, it will flush the servers in the order that they were
added.
-
-------
RETURN
------
-
-A value of type :type:`memcached_return_t` is returned
+A value of type :type:`memcached_return_t` is returned
On success that value will be `MEMCACHED_SUCCESS`.
Use :type:`memcached_strerror` to translate this value to a printable string.
-
--------
SEE ALSO
--------
Flushing client buffers
=======================
-
.. index:: object: memcached_st
Flush and send buffered commands
--------
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_flush_buffers (memcached_st *ptr)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
-:func:`memcached_flush_buffers` is used in conjunction with
+:func:`memcached_flush_buffers` is used in conjunction with
`MEMCACHED_BEHAVIOR_BUFFER_REQUESTS` (see memcached_behavior(3)) to flush all buffers by sending the buffered commands to the server for processing.
-
------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned
On success that value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
string.
-
-
-
--------
SEE ALSO
--------
Hash a key value
-
---------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
.. type:: memcached_hash_t
-
+
.. function:: uint32_t memcached_generate_hash_value (const char *key, size_t key_length, memcached_hash_t hash_algorithm)
.. function:: uint32_t memcached_generate_hash (memcached_st *ptr, const char *key, size_t key_length)
.. type:: MEMCACHED_HASH_MURMUR3
-
Compile and link with -lmemcachedutil -lmemcached
-
-----------
DESCRIPTION
-----------
-
:func:`memcached_generate_hash_value` allows you to hash a key using one of
the hash functions defined in the library. This method is provided for
the convenience of higher-level language bindings and is not necessary
As of version 0.36 all hash methods have been placed into the library
libhashkit(3) which is linked with libmemcached(3). For more information please see its documentation.
-
------
RETURN
------
-
A 32-bit integer which is the result of hashing the given key.
For 64-bit hash algorithms, only the least-significant 32 bits are
returned.
-
-
--------
SEE ALSO
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_result_st * memcached_fetch_result (memcached_st *ptr, memcached_result_st *result, memcached_return_t *error)
.. function:: char * memcached_get (memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error)
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
-:func:`memcached_get` is used to fetch an individual value from the server.
+:func:`memcached_get` is used to fetch an individual value from the server.
You must pass in a key and its length to fetch the object. You must supply
three pointer variables which will give you the state of the returned
object. A :type:`uint32_t` pointer to contain whatever flags you stored with the value, a :type:`size_t` pointer which will be filled with size of of
object returned by :func:`memcached_get` must be released by the caller
application.
-:func:`memcached_mget` is used to select multiple keys at once. For
+:func:`memcached_mget` is used to select multiple keys at once. For
multiple key operations it is always faster to use this function. This function always works asynchronously.
To retrieve data after a successful execution of :func:`memcached_mget`, you will need to
it returns a NULL (i.e. no more values). If you need to quit in the middle of a
:func:`memcached_mget` call, you can execute a :func:`memcached_quit`, those this is not required.
-:func:`memcached_fetch_result` is used to fetch an individual value from the server. :func:`memcached_mget` must always be called before using this method.
+:func:`memcached_fetch_result` is used to fetch an individual value from the server. :func:`memcached_mget` must always be called before using this method.
You must pass in a key and its length to fetch the object. You must supply
three pointer variables which will give you the state of the returned
object. A :type:`uint32_t` pointer to contain whatever flags you stored with the value, a :type:`size_t` pointer which will be filled with size of of the
object, and a :type:`memcached_return_t` pointer to hold any error. The
object will be returned upon success and NULL will be returned on failure. `MEMCACHED_END` is returned by the \*error value when all objects that have been found are returned. The final value upon `MEMCACHED_END` is null.
-:func:`memcached_fetch_result` is used to return a :type:`memcached_result_st` structure from a memcached server. The result object is forward compatible
+:func:`memcached_fetch_result` is used to return a :type:`memcached_result_st` structure from a memcached server. The result object is forward compatible
with changes to the server. For more information please refer to the
:type:`memcached_result_st` help. This function will dynamically allocate a
result structure for you if you do not pass one to the function.
-:func:`memcached_fetch_execute` is a callback function for result sets.
+:func:`memcached_fetch_execute` is a callback function for result sets.
Instead of returning the results to you for processing, it passes each of the
result sets to the list of functions you provide. It passes to the function
a :type:`memcached_st` that can be cloned for use in the called
sending out requests. Please note that this function is only available in
the binary protocol.
-:func:`memcached_get_by_key` and :func:`memcached_mget_by_key` behave
+:func:`memcached_get_by_key` and :func:`memcached_mget_by_key` behave
in a similar nature as :func:`memcached_get` and :func:`memcached_mget`.
The difference is that they take a master key that is used for determining
which server an object was stored if key partitioning was used for storage.
-All of the above functions are not tested when the
+All of the above functions are not tested when the
`MEMCACHED_BEHAVIOR_USE_UDP` has been set. Executing any of these
functions with this behavior on will result in `MEMCACHED_NOT_SUPPORTED` being returned, or for those functions which do not return a :type:`memcached_return_t`, the error function parameter will be set to `MEMCACHED_NOT_SUPPORTED`.
-
-------
RETURN
------
-
All objects retrieved via :func:`memcached_get` or :func:`memcached_get_by_key` must be freed with :manpage:`free(3)`.
-:func:`memcached_get` will return NULL on
+:func:`memcached_get` will return NULL on
error. You must look at the value of error to determine what the actual error
was.
to `MEMCACHED_END` upon successful conclusion.
`MEMCACHED_NOTFOUND` will be return if no keys at all were found.
-
--------
SEE ALSO
--------
Compile and link with -lmemcached
.. function:: memcached_return_t memcached_last_error(const memcached_st *)
-
+
.. function:: const char *memcached_last_error_message(const memcached_st *)
.. function:: int memcached_last_error_errno(const memcached_st *)
`memcached_last_error_errno` returns any last local error code obtained from
:manpage:`errno(3)`.
-
SEE ALSO
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
.. function:: memcached_return_t memcached_set_memory_allocators (memcached_st *ptr, memcached_malloc_fn mem_malloc, memcached_free_fn mem_free, memcached_realloc_fn mem_realloc, memcached_calloc_fn mem_calloc, void *context)
Compile and link with -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
libmemcached(3) allows you to specify your own memory allocators, optimized
for your application. This enables libmemcached to be used inside of applications that have their own malloc implementation.
-:func:`memcached_set_memory_allocators` is used to set the memory
+:func:`memcached_set_memory_allocators` is used to set the memory
allocators used by the memcached instance specified by ptr. Please note that
you cannot override only one of the memory allocators, you have to specify a
complete new set if you want to override one of them. All of the memory
allocation functions should behave as specified in the C99 standard. Specify
NULL as all functions to reset them to the default values.
-:func:`memcached_get_memory_allocators` is used to get the currently used
+:func:`memcached_get_memory_allocators` is used to get the currently used
memory allocators by a memcached handle.
-:func:`memcached_get_memory_allocators_context` returns the void \* that
+:func:`memcached_get_memory_allocators_context` returns the void \* that
was passed in during the call to :func:`memcached_set_memory_allocators`.
The first argument to the memory allocator functions is a pointer to a
memcached structure, the is passed as const and you will need to clone
it in order to make use of any operation which would modify it.
-
-----
NOTES
-----
-
In version 0.38 all functions were modified to have a context void pointer
passed to them. This was so that customer allocators could have their
own space for memory.
-
------
RETURN
------
-
-:func:`memcached_set_memory_allocators` return `MEMCACHED_SUCCESS`
+:func:`memcached_set_memory_allocators` return `MEMCACHED_SUCCESS`
upon success, and `MEMCACHED_FAILURE` if you don't pass a complete set
of function pointers.
-
--------
SEE ALSO
--------
--------
#include <libmemcached/memcached.h>
-
+
.. function:: void memcached_quit (memcached_st *ptr)
Compile and link with -lmemcached
DESCRIPTION
-----------
-
-:func:`memcached_quit` will disconnect you from all currently connected
+:func:`memcached_quit` will disconnect you from all currently connected
servers. It will also reset the state of the connection (ie, any :func:`memcached_fetch` you are in the middle of will be terminated). This function is
called automatically when you call :func:`memcached_free` on the :type:`memcached_st` structure.
function is provided mainly so that you can timeout your connections or
reset connections during the middle of a :func:`memcached_fetch`.
-
------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned On success that value
will be `MEMCACHED_SUCCESS`. Use :func:`memcached_strerror` to
translate this value to a printable string.
-
--------
SEE ALSO
--------
Compile and link with -lmemcachedutil -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
-libmemcached(3) can optionally return a :type:`memcached_result_st` which
+libmemcached(3) can optionally return a :type:`memcached_result_st` which
acts as a result object. The result objects have added benefits over the
character pointer returns, in that they are forward compatible with new
return items that future memcached servers may implement (the best current
:func:`memcached_result_key_value` returns the key value associated with the
current result object.
-:func:`memcached_result_key_length` returns the key length associated with
+:func:`memcached_result_key_length` returns the key length associated with
the current result object.
:func:`memcached_result_value` returns the result value associated with the
value, unless you have made use of a custom allocator. Use of a custom
allocator requires that you create your own custom free() to release it.
-:func:`memcached_result_length` returns the result length associated with
+:func:`memcached_result_length` returns the result length associated with
the current result object.
:func:`memcached_result_flags` returns the flags associated with the
stack based allocation. The most common issues related to ABI safety involve
heap allocated structures.
-
------
RETURN
------
-
Varies, see particular functions. All structures must have
:func:`memcached_result_free` called on them for cleanup purposes. Failure
to do this will result in leaked memory.
-
-
--------
SEE ALSO
--------
.. index:: object: memcached_st
-
--------
SYNOPSIS
--------
Compile and link with -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
libmemcached(3) allows you to plug in your own callbacks function used by
libsasl to perform SASL authentication.
:type:`memcached_destroy_sasl_auth_data` if you specify your own callback
function with :func:`memcached_set_sasl_callbacks`.
-
------
RETURN
------
-
:func:`memcached_get_sasl_callbacks` returns the callbacks currently used by
this memcached handle. :func:`memcached_set_sasl_auth_data` returns
`MEMCACHED_SUCCESS` upon success.
-
-
--------
SEE ALSO
--------
.. function:: const memcached_instance_st * memcached_server_list (memcached_st *ptr)
.. function:: void memcached_server_list_free (memcached_server_list_st list)
-
+
.. function:: memcached_server_list_st memcached_server_list_append (memcached_server_list_st list, const char *hostname, in_port_t port, memcached_return_t *error)
-
+
.. function:: uint32_t memcached_server_list_count (memcached_server_list_st list)
-
+
.. function:: const char *memcached_server_error (const memcached_instance_st * instance)
-
+
.. function:: void memcached_server_error_reset (const memcached_instance_st * list)
.. deprecated:: 0.39
Manipulate the server information stored in memcached_st
========================================================
---------
SYNOPSIS
--------
#include <libmemcached/memcached.h>
-
+
.. type:: memcached_server_fn
.. function:: uint32_t memcached_server_count (memcached_st *ptr)
.. function:: memcached_return_t memcached_server_add_unix_socket (memcached_st *ptr, const char *socket)
-.. function:: memcached_return_t memcached_server_push (memcached_st *ptr, const memcached_server_st *list)
+.. function:: memcached_return_t memcached_server_push (memcached_st *ptr, const memcached_server_st *list)
.. function:: const memcached_instance_st * memcached_server_by_key (memcached_st *ptr, const char *key, size_t key_length, memcached_return_t *error)
compile and link with -lmemcached
-
-
------------
DESCRIPTION
-----------
-
`libmemcached` performs operations on a list of hosts. The order of
these hosts determine routing to keys. Functions are provided to add keys to
memcached_st structures. To manipulate lists of servers see
:func:`memcached_server_add` pushes a single TCP server into the :type:`memcached_st` structure. This server will be placed at the end. Duplicate servers
are allowed, so duplication is not checked. Executing this function with the `MEMCACHED_BEHAVIOR_USE_UDP` behavior set will result in a `MEMCACHED_INVALID_HOST_PROTOCOL`.
-:func:`memcached_server_add_udp` pushes a single UDP server into the :type:`memcached_st` structure. This server will be placed at the end. Duplicate
+:func:`memcached_server_add_udp` pushes a single UDP server into the :type:`memcached_st` structure. This server will be placed at the end. Duplicate
servers are allowed, so duplication is not checked. Executing this function with out setting the `MEMCACHED_BEHAVIOR_USE_UDP` behavior will result in a
`MEMCACHED_INVALID_HOST_PROTOCOL`.
Duplicate servers are allowed, so duplication is not checked. The length
of the filename must be one character less than `MEMCACHED_MAX_HOST_LENGTH`.
-:func:`memcached_server_push` pushes an array of :type:`memcached_server_st` into the :type:`memcached_st` structure. These servers will be placed at
+:func:`memcached_server_push` pushes an array of :type:`memcached_server_st` into the :type:`memcached_st` structure. These servers will be placed at
the end. Duplicate servers are allowed, so duplication is not checked. A
copy is made of structure so the list provided (and any operations on
the list) are not saved.
:func:`memcached_server_by_key` allows you to provide a key and retrieve the
server which would be used for assignment.
-:func:`memcached_server_get_last_disconnect` returns a pointer to the last
+:func:`memcached_server_get_last_disconnect` returns a pointer to the last
server for which there was a connection problem. It does not mean this
particular server is currently dead but if the library is reporting a server
is, the returned server is a very good candidate.
-:func:`memcached_server_cursor` takes a memcached_st and loops through the
+:func:`memcached_server_cursor` takes a memcached_st and loops through the
list of hosts currently in the cursor calling the list of callback
functions provided. You can optionally pass in a value via
context which will be provided to each callback function. An error
return from any callback will terminate the loop. :func:`memcached_server_cursor` is passed the original caller :type:`memcached_st` in its current state.
-
------
RETURN
------
-
Varies, see particular functions.
-
--------
SEE ALSO
--------
memcached(1) server. You must supply both a value and a length. Optionally you
may test an expiration time for the object and a 16 byte value (it is meant to be used as a bitmap). "flags" is a 4byte space that is stored alongside of the main value. Many sub libraries make use of this field, so in most cases users should avoid making use of it.
-:func:`memcached_set` will write an object to the server. If an object
+:func:`memcached_set` will write an object to the server. If an object
already exists it will overwrite what is in the server. If the object does not
exist it will be written. If you are using the non-blocking mode this function
will always return true unless a network error occurs.
--------
#include <libmemcached/memcached.h>
-
+
.. function:: void memcached_set_encoding_key (memcached_st *ptr, const char *string, const size_t string_length)
Compile and link with -lmemcached
DESCRIPTION
-----------
-
:func:`memcached_set_encoding_key` sets the key that will be used to encrypt and decrypt data as it is sent and received from the server.
Currently only AES is is supported.
-
-------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned On success that value
will be `MEMCACHED_SUCCESS`. Use :func:`memcached_strerror` to
translate this value to a printable string.
-
-
--------
SEE ALSO
--------
Working with statistical information from a server
==================================================
-
Get memcached statistics
.. index:: object: memcached_st
-
--------
SYNOPSIS
--------
DESCRIPTION
-----------
-
libmemcached(3) has the ability to query a memcached server (or collection
of servers) for their current state. Queries to find state return a
:type:`memcached_stat_st` structure. You are responsible for freeing this structure. While it is possible to access the structure directly it is not advisable. :func:`memcached_stat_get_value` has been provided to query the structure.
A command line tool, memstat(1), is provided so that you do not have to write
an application to do this.
-
------
RETURN
------
-
Varies, see particular functions.
Any method returning a :type:`memcached_stat_st` expects you to free the
memory allocated for it.
-
-
--------
SEE ALSO
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
-
+
.. function:: memcached_return_t memcached_touch (memcached_st *ptr, const char *key, size_t key_length, time_t expiration)
.. function:: memcached_return_t memcached_touch_by_key (memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, time_t expiration)
DESCRIPTION
-----------
-
:func:`memcached_touch` is used to update the expiration time on an existing key.
:func:`memcached_touch_by_key` works the same, but it takes a master key
to find the given value.
-
------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned
On success that value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable
string.
-
-
--------
SEE ALSO
--------
Manage user specific data
-
-------
LIBRARY
-------
-
C Client Library for memcached (libmemcached, -lmemcached)
-
--------
SYNOPSIS
--------
-
#include <libmemcached/memcached.h>
.. function:: void *memcached_get_user_data (memcached_st *ptr)
Compile and link with -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
libmemcached(3) allows you to store a pointer to a user specific data inside
the memcached_st structure.
:func:`memcached_get_user_data` is used to retrieve the user specific data in the :type:`memcached_st` structure.
-
------
RETURN
------
-
:func:`memcached_set_user_data` returns the previous value of the user specific data.
:func:`memcached_get_user_data` returns the current value uf the user specific data.
-
-
--------
SEE ALSO
--------
Compile and link with -lmemcached
-
-----------
DESCRIPTION
-----------
-
:func:`memcached_verbosity` modifies the "verbosity" of the
memcached(1) servers referenced in the :type:`memcached_st` parameter.
-
------
RETURN
------
-
A value of type :type:`memcached_return_t` is returned.
On success that value will be `MEMCACHED_SUCCESS`.
Use :func:`memcached_strerror` to translate this value to a printable string.
-
--------
SEE ALSO
--------
Getting version information about the client and server
=======================================================
-
--------
SYNOPSIS
--------
#include <libmemcached/memcached.h>
-.. function:: const char * memcached_lib_version (void)
+.. function:: const char * memcached_lib_version (void)
.. function:: memcached_return_t memcached_version (memcached_st *ptr)
-
Compile and link with -lmemcached
-
-
-----------
DESCRIPTION
-----------
-
:func:`memcached_lib_version` is used to return a simple version string representing the libmemcached version (client library version, not server version)
:func:`memcached_version` is used to set the major, minor, and micro versions of each memcached server being used by the memcached_st connection structure. It returns the memcached server return code.
-
------
RETURN
------
-
:func:`memcached_lib_version` returns a string with the version of the libmemcached driver.
A value of :type:`memcached_return_t` is returned from :func:'memcached_version'
-On success that value will be `MEMCACHED_SUCCESS`.
+On success that value will be `MEMCACHED_SUCCESS`.
If called with the `MEMCACHED_BEHAVIOR_USE_UDP` behavior set, the value
`MEMCACHED_NOT_SUPPORTED` will be returned.
-Use :func:`memcached_strerror` to translate this value to
+Use :func:`memcached_strerror` to translate this value to
a printable string.
-
-
--------
SEE ALSO
--------
-============================
Working with memcached pools
============================
---------
SYNOPSIS
--------
.. type:: struct memcached_pool_st memcached_pool_st
-.. function:: memcached_pool_st* memcached_pool(const char *option_string, size_t option_string_length)
+.. function:: memcached_pool_st* memcached_pool(const char *option_string, size_t option_string_length)
.. function:: memcached_st* memcached_pool_destroy(memcached_pool_st* pool)
-
+
.. function:: memcached_st* memcached_pool_fetch(memcached_pool_st*, struct timespec* relative_time, memcached_return_t* rc)
.. versionadded:: 0.53
Synonym for memcached_pool_pop
.. function:: memcached_return_t memcached_pool_release(memcached_pool_st* pool, memcached_st* mmc)
.. versionadded:: 0.53
Synonym for memcached_pool_push.
-
+
.. function:: memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t data)
-
-.. function:: memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value)
+.. function:: memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value)
.. function:: memcached_pool_st* memcached_pool_create(memcached_st* mmc, int initial, int max)
.. deprecated:: 0.46
.. deprecated:: 0.53
Use :func:`memcached_pool_release`
-
------------
DESCRIPTION
-----------
-
-:func:`memcached_pool` is used to create a connection pool of objects you
+:func:`memcached_pool` is used to create a connection pool of objects you
may use to remove the overhead of using memcached_clone for short lived
:type:`memcached_st` objects. Please see :doc:`../libmemcached/configuration`
for details on the format of the configuration string.
Both :func:`memcached_pool_release` and :func:`memcached_pool_fetch` are
thread safe.
-------
RETURN
------
waiting for a free memcached_st. MEMCACHED_NOTFOUND if no memcached_st was
available.
-
-
---------
SEE ALSO
--------