1 C/C++ Client Library for memcached
2 ==================================
7 #include <libmemcached/memcached.h>
8 Compile and link with -lmemcached
12 `libmemcached` is an open source C/C++ client library and tools for the
13 memcached server (http://memcached.org/). It has been designed to be light on
14 memory usage, thread safe, and provide full access to server side methods.
16 `libmemcached` was designed to provide the greatest number of options to use
17 Memcached. Some of the features provided:
19 1. Asynchronous and Synchronous Transport Support.
20 2. Consistent Hashing and Distribution.
21 3. Tunable Hashing algorithm to match keys.
22 4. Access to large object support.
24 6. A complete reference guide and documentation to the API.
25 7. Tools to Manage your Memcached networks.
30 "Memcached is a high-performance, distributed memory object caching
31 system, generic in nature, but intended for use in speeding up dynamic web
32 applications by alleviating database load."
33 `http://memcached.org/ <http://memcached.org/>`_
35 `libmemcached` is a small, thread-safe client library for the
36 memcached protocol. The code has all been written to allow
37 for both web and embedded usage. It handles the work behind routing
38 individual keys to specific servers specified by the developer (and values are
39 matched based on server order as supplied by the user). It implements
40 a modular and consistent method of object distribution.
42 There are multiple implemented routing and hashing methods. See the
43 :func:`memcached_behavior_set` manpage for more information.
45 All operations are performed against a :type:`memcached_st` structure.
46 These structures can either be dynamically allocated or statically
47 allocated and then initialized by :func:`memcached_create`. Functions have
48 been written in order to encapsulate the :type:`memcached_st`. It is not
49 recommended that you operate directly against the structure.
51 Nearly all functions return a :type:`memcached_return_t` value.
52 This value can be translated to a printable string with
53 :type:`memcached_strerror`.
55 Objects are stored on servers by hashing keys. The hash value maps the key to a
56 particular server. All clients understand how this hashing works, so it is
57 possibly to reliably both push data to a server and retrieve data from a server.
59 Group keys can be optionally used to group sets of objects with servers.
61 Namespaces are supported, and can be used to partition caches so that multiple
62 applications can use the same memcached servers.
64 Some features of the library must be enabled through `memcached_behavior_set`.
69 A number of constants have been provided for in the library.
73 See :manpage:`libmemcached_constants(3)`.
77 See :doc:`libmemcached/constants`.
82 No global variables are used in this library.
84 :type:`memcached_st` structures are thread-safe, but when using threads or
85 forked processes it is important to keep one instance of :type:`memcached_st`
86 per process or thread. Without creating your own locking structures you can not
87 share a single :type:`memcached_st`. However, you can call
88 :func:`memcached_quit` on a :type:`memcached_st` and then use the resulting
94 `libmemcached` can be built to support Systemtap on Linux when enabled at
97 Please see :manpage:`stap(1)` and :manpage:`dtrace(1)` for more information
103 `libmemcached` comes with a few useful client programs:
107 :manpage:`memcached(1)`
108 :manpage:`memaslap(1)`
109 :manpage:`memcapable(1)`
112 :manpage:`memdump(1)`
113 :manpage:`memerror(1)`
114 :manpage:`memexist(1)`
115 :manpage:`memflush(1)`
116 :manpage:`memparse(1)`
117 :manpage:`memping(1)`
119 :manpage:`memslap(1)`
120 :manpage:`memstat(1)`
121 :manpage:`memtouch(1)`
125 * :doc:`bin/memaslap`
126 * :doc:`bin/memcapable`
130 * :doc:`bin/memerror`
131 * :doc:`bin/memexist`
132 * :doc:`bin/memflush`
133 * :doc:`bin/memparse`
138 * :doc:`bin/memtouch`
145 :manpage:`libhashkit(3)`
146 :manpage:`libmemcachedutil(3)`
151 * :doc:`libmemcachedutil`
158 :manpage:`memcached(1)`
160 :manpage:`libmemcached_configuration(3)`
161 :manpage:`libmemcached_examples(3)`
163 :manpage:`memcached_analyze(3)`
164 :manpage:`memcached_append(3)`
165 :manpage:`memcached_auto(3)`
166 :manpage:`memcached_behavior(3)`
167 :manpage:`memcached_callback(3)`
168 :manpage:`memcached_cas(3)`
169 :manpage:`memcached_create(3)`
170 :manpage:`memcached_delete(3)`
171 :manpage:`memcached_dump(3)`
172 :manpage:`memcached_exist(3)`
173 :manpage:`memcached_fetch(3)`
174 :manpage:`memcached_flush(3)`
175 :manpage:`memcached_flush_buffers(3)`
176 :manpage:`memcached_generate_hash_value(3)`
177 :manpage:`memcached_get(3)`
178 :manpage:`memcached_last_error_message(3)`
179 :manpage:`memcached_memory_allocators(3)`
180 :manpage:`memcached_pool(3)`
181 :manpage:`memcached_quit(3)`
182 :manpage:`memcached_result_st(3)`
183 :manpage:`memcached_return_t(3)`
184 :manpage:`memcached_sasl(3)`
185 :manpage:`memcached_servers(3)`
186 :manpage:`memcached_server_st(3)`
187 :manpage:`memcached_set(3)`
188 :manpage:`memcached_set_encoding_key(3)`
189 :manpage:`memcached_stats(3)`
190 :manpage:`memcached_strerror(3)`
191 :manpage:`memcached_touch(3)`
192 :manpage:`memcached_user_data(3)`
193 :manpage:`memcached_verbosity(3)`
194 :manpage:`memcached_version(3)`
198 * :manpage:`memcached(1)`
200 * :doc:`libmemcached/configuration`
201 * :doc:`libmemcached/examples`