struct tapi_memcached_opt
Overview
Specific memcached options. More…
#include <tapi_memcached.h> struct tapi_memcached_opt { // fields bool maxconns_fast; bool no_maxconns_fast; tapi_job_opt_uint_t hashpower; tapi_job_opt_uint_t tail_repair_time; bool no_lru_crawler; tapi_job_opt_uint_t lru_crawler_sleep; tapi_job_opt_uint_t lru_crawler_tocrawl; bool no_lru_maintainer; tapi_job_opt_uint_t hot_lru_pct; tapi_job_opt_uint_t warm_lru_pct; tapi_job_opt_double_t hot_max_factor; tapi_job_opt_double_t warm_max_factor; tapi_job_opt_uint_t temporary_ttl; tapi_job_opt_uint_t idle_timeout; tapi_job_opt_uint_t watcher_logbuf_size; tapi_job_opt_uint_t worker_logbuf_size; bool track_sizes; bool no_hashexpand; struct tapi_memcached_opt::@85 ext_path; tapi_job_opt_uint_t ext_page_size; tapi_job_opt_uint_t ext_wbuf_size; tapi_job_opt_uint_t ext_threads; tapi_job_opt_uint_t ext_item_size; tapi_job_opt_uint_t ext_item_age; tapi_job_opt_uint_t ext_low_ttl; bool ext_drop_unread; tapi_job_opt_uint_t ext_recache_rate; tapi_job_opt_uint_t ext_compact_under; tapi_job_opt_uint_t ext_drop_under; tapi_job_opt_double_t ext_max_frag; tapi_job_opt_double_t slab_automove_freeratio; const char* unix_socket; bool enable_ascii_shutdown; tapi_job_opt_uint_t unix_mask; const struct sockaddr* listen_ipaddr; const char* username; tapi_job_opt_uint_t memory_limit; tapi_job_opt_uint_t conn_limit; tapi_job_opt_uint_t max_reqs_per_event; bool lock_memory; const struct sockaddr* tcp_port; const struct sockaddr* udp_port; bool disable_evictions; bool enable_coredumps; tapi_job_opt_double_t slab_growth_factor; tapi_job_opt_uint_t slab_min_size; bool disable_cas; tapi_mamcached_verbose_t verbose; tapi_job_opt_uint_t threads; tapi_job_opt_uint_t napi_ids; const char* delimiter; bool enable_largepages; tapi_job_opt_uint_t listen_backlog; tapi_mamcached_proto_t protocol; tapi_job_opt_uint_t max_item_size; bool enable_sasl; bool disable_flush_all; bool disable_dumping; bool disable_watch; const char* path; tapi_job_opt_uint_t size; const char* memcached_path; };
Detailed Documentation
Specific memcached options.
Fields
bool maxconns_fast
Immediately close new connections after limit.
bool no_maxconns_fast
Cancel maxconns_fast option.
tapi_job_opt_uint_t hashpower
An integer multiplier for how large the hash table should be. Normally grows at runtime. Set based on “STAT hash_power_level”.
tapi_job_opt_uint_t tail_repair_time
Time in seconds for how long to wait before forcefully killing LRU tail item. Very dangerous option!
bool no_lru_crawler
Disable LRU Crawler background thread.
tapi_job_opt_uint_t lru_crawler_sleep
Microseconds to sleep between items.
tapi_job_opt_uint_t lru_crawler_tocrawl
Max items to crawl per slab per run (if 0 then unlimited).
bool no_lru_maintainer
Disable new LRU system + background thread.
tapi_job_opt_uint_t hot_lru_pct
pct of slab memory to reserve for hot lru. Requires lru_maintainer.
tapi_job_opt_uint_t warm_lru_pct
pct of slab memory to reserve for warm lru. Requires lru_maintainer.
tapi_job_opt_double_t hot_max_factor
Items idle > cold lru age * drop from hot lru.
tapi_job_opt_double_t warm_max_factor
Items idle > cold lru age * this drop from warm.
tapi_job_opt_uint_t temporary_ttl
TTL’s below get separate LRU, can’t be evicted. Requires lru_maintainer.
tapi_job_opt_uint_t idle_timeout
Timeout for idle connections (if 0 then no timeout).
tapi_job_opt_uint_t watcher_logbuf_size
Size in kilobytes of per-watcher write buffer.
tapi_job_opt_uint_t worker_logbuf_size
Size in kilobytes of per-worker-thread buffer read by background thread, then written to watchers.
bool track_sizes
Enable dynamic reports for ‘stats sizes’ command.
bool no_hashexpand
Disables hash table expansion. Dangerous!
unnamed-struct ext_path
File to write to for external storage.
Example: "ext_path=/mnt/d1/extstore:1G"
. This initializes extstore with up to 5 gigabytes of storage. Storage is split internally into pages size of ext_page_size
.
tapi_job_opt_uint_t ext_page_size
Size of storage pages, in megabytes.
tapi_job_opt_uint_t ext_wbuf_size
Size of page write buffers, in megabytes.
tapi_job_opt_uint_t ext_threads
Number of IO threads to run.
If you have a high read latency but the drive is idle, you can increase this number. Stick to low values; no more than 8 threads.
tapi_job_opt_uint_t ext_item_size
Store items larger than this, in bytes.
Items larger than this can be flushed. You can lower this value if you want to save a little extra RAM and your keys are short. You can also raise this value if you only wish to flush very large objects, which is a good place to start.
tapi_job_opt_uint_t ext_item_age
Store items idle at least this long, in seconds. If not used then no age limit.
tapi_job_opt_uint_t ext_low_ttl
Consider TTLs lower than this specially.
bool ext_drop_unread
Don’t re-write unread values during compaction.
tapi_job_opt_uint_t ext_recache_rate
Recache an item every N accesses.
If an item stored on flash has been accessed more than once in the last minute, it has a one in N chance of being recached into RAM and removed from flash. It’s good to keep this value high; recaches into RAM cause fragmentation on disk, and it’s rare for objects in flash to become frequently accessed. If they do, they will eventually be recached.
tapi_job_opt_uint_t ext_compact_under
Compact when fewer than this many free pages.
tapi_job_opt_uint_t ext_drop_under
Drop COLD items when fewer than this many free pages.
tapi_job_opt_double_t ext_max_frag
Max page fragmentation to tolerate.
Example: “ext_max_frag=0.5” This will rewrite pages which are at least half empty. If no pages are half empty, the oldest page will be evicted.
tapi_job_opt_double_t slab_automove_freeratio
Ratio of memory to hold free as buffer.
const char* unix_socket
Unix socket path to listen on (disables network support).
bool enable_ascii_shutdown
Enable ascii “shutdown” command.
tapi_job_opt_uint_t unix_mask
Permissions (in octal form) for Unix socket created with -s option.
const struct sockaddr* listen_ipaddr
Listen on ip_addr
.
const char* username
Assume the identity of username
.
tapi_job_opt_uint_t memory_limit
Memory usage in MB.
tapi_job_opt_uint_t conn_limit
Max simultaneous connections.
tapi_job_opt_uint_t max_reqs_per_event
Once a connection exceeds this number of consecutive requests, the server will try to process I/O on other connections before processing any further requests from that connection.
bool lock_memory
Lock down all paged memory. This is a somewhat dangerous option with large caches.
const struct sockaddr* tcp_port
TCP port to listen on (0 by default, 0 to turn off).
To set 0 use zero_sockaddr
.
const struct sockaddr* udp_port
UDP port to listen on (0 by default, 0 to turn off).
To set 0 use zero_sockaddr
.
bool disable_evictions
Disable automatic removal of items from the cache when out of memory. Additions will not be possible until adequate space is freed up.
bool enable_coredumps
Raise the core file size limit to the maximum allowable.
tapi_job_opt_double_t slab_growth_factor
A lower value may result in less wasted memory depending on the total amount of memory available and the distribution of item sizes.
tapi_job_opt_uint_t slab_min_size
Allocate a minimum of size
bytes for the item key, value, and flags.
bool disable_cas
Disable the use of CAS (and reduce the per-item size by 8 bytes).
tapi_mamcached_verbose_t verbose
Be verbose during the event loop. Print out errors and warnings (none by default).
tapi_job_opt_uint_t threads
Number of threads to use to process incoming requests.
tapi_job_opt_uint_t napi_ids
Number of NAPI ids (see napi_ids.txt in memcached docs for details)
const char* delimiter
One char delimiter between key prefixes and IDs. This is used for per-prefix stats reporting.
bool enable_largepages
Try to use large memory pages (if available). Increasing the memory page size could reduce the number of TLB misses and improve the performance.
tapi_job_opt_uint_t listen_backlog
Set the backlog queue limit to number of connections.
tapi_mamcached_proto_t protocol
Specify the binding protocol to use (“auto” by default).
tapi_job_opt_uint_t max_item_size
Override the default size of each slab page in Kilobytes.
bool enable_sasl
Turn on SASL authentication. This option is only meaningful if memcached was compiled with SASL support enabled.
bool disable_flush_all
Disable the “flush_all” command. The cmd_flush counter will increment, but clients will receive an error message and the flush will not occur.
bool disable_dumping
Disable the “stats cachedump” and “lru_crawler metadump” commands.
bool disable_watch
Disable watch commands (live logging).
const char* memcached_path
Path to memcached exec (if NULL
then “memcached”).