The download links include:

IQ-Twemcached memcached-like server that supports the IQ framework

IQ-Whalin Client Java client used to communicate with the IQ-Twemcached server

This implementation developed from version 2.6.1 of Whalin Client

Sample BG Client Sample BG client to test for the correctness and performance of IQ-Twemcached

See BG Website on how to install and use the provided sample clients.



IQ-Twemcached is a fork of Twemcache version 2.5.3 and implemented using the C programming language.

Install libevent

IQ-Twemcached requires an installation of an event notification library named libevent. Download and install libevent from its official website.

Install IQ-Twemcached

To build IQ-Twemcached

                                        $ ./configure
                                        $ make install

To build IQ-Twemcached in debug mode with assertion panics enabled

                                        $ CFLAGS="-ggdb3 -O0" ./configure --enable-debug=full
                                        $ make


                                        twemcache [-?hVCELdkrDS] [-o output file] [-v verbosity level]
                                                   [-A stats aggr interval]
                                                   [-t threads] [-P pid file] [-u user]
                                                   [-x command logging entry] [-X command logging file]
                                                   [-R max requests] [-c max conns] [-b backlog] [-p port] [-U udp port]
                                                   [-l interface] [-s unix path] [-a access mask] [-M eviction strategy]
                                                   [-f factor] [-m max memory] [-n min item chunk size] [-I slab size]
                                                   [-z slab profile] 

                                          -h, --help                  : this help
                                          -V, --version               : show version and exit
                                          -E, --prealloc              : preallocate memory for all slabs
                                          -L, --use-large-pages       : use large pages if available
                                          -k, --lock-pages            : lock all pages and preallocate slab memory
                                          -d, --daemonize             : run as a daemon
                                          -r, --maximize-core-limit   : maximize core file limit
                                          -C, --disable-cas           : disable use of cas
                                          -D, --describe-stats        : print stats description and exit
                                          -S, --show-sizes            : print slab and item struct sizes and exit
                                          -o, --output=S              : set the logging file (default: stderr)
                                          -v, --verbosity=N           : set the logging level (default: 5, min: 0, max: 11)
                                          -A, --stats-aggr-interval=N : set the stats aggregation interval in usec (default: 100000 usec)
                                          -t, --threads=N             : set number of threads to use (default: 4)
                                          -P, --pidfile=S             : set the pid file (default: off)
                                          -u, --user=S                : set user identity when run as root (default: off)
                                          -x, --klog-entry=N          : set the command logging entry number per thread (default: 512)
                                          -X, --klog-file=S           : set the command logging file (default: off)
                                          -R, --max-requests=N        : set the maximum number of requests per event (default: 20)
                                          -c, --max-conns=N           : set the maximum simultaneous connections (default: 1024)
                                          -b, --backlog=N             : set the backlog queue limit (default 1024)
                                          -p, --port=N                : set the tcp port to listen on (default: 11211)
                                          -U, --udp-port=N            : set the udp port to listen on (default: 11211)
                                          -l, --interface=S           : set the interface to listen on (default: all)
                                          -s, --unix-path=S           : set the unix socket path to listen on (default: off)
                                          -a, --access-mask=O         : set the access mask for unix socket in octal (default: 0700)
                                          -M, --eviction-strategy=N   : set the eviction strategy on OOM (default: 2, random)
                                          -f, --factor=D              : set the growth factor of slab item sizes (default: 1.25)
                                          -m, --max-memory=N          : set the maximum memory to use for all items in MB (default: 64 MB)
                                          -n, --min-item-chunk-size=N : set the minimum item chunk size in bytes (default: 72 bytes)
                                          -I, --slab-size=N           : set slab size in bytes (default: 1048576 bytes)
                                          -z, --slab-profile=S        : set the profile of slab item chunk sizes (default: off)
                                          -G                          : set expired lease time (default: 0)
                                          -g                          : set the percentage for the reserved spaces (for storing leases and transaction items)

For example, to start IQ-Twemcached configured with 4 threads, 16 connections, 1GB memory size with 10% of its size is for reserved space, and lease expiration time set to 30 seconds:

                                        src/twemcache –t 1 –c 16 –m 1000 -g 10 –G 30000

The expired lease time parameter (-G 30000) is important. Without specifying this value, the default value (0) will be chosen, producing stale data.

IQ-Whalin Client

Download the IQ-Whalin Client jar file and use it in your application to issue requests to the IQ-Twemcached server.