First, memcached installation
memcached Dependency$ sudo apt-get install Libevent-dev
Installing the memcached service$ sudo apt-get install memcached
Second, start
before starting$ FREE to view idle memory main concern is the third row,-/+ Buffers/cache in the corresponding memory, is the application can see the size of the available memory. Total idle memory = True idle memory + fast-recovering memory buffers+ Memory Cached http://linuxtools-rst.readthedocs.org/zh_CN/latest/tool/ Free.html from the operating system perspective: Cache for read operations, buffer for write operations
Start$ memcached-d-M 64-p 11211
View Help$ memcached-h
Common Commands-D daemon-m setting memcached maximum available memory-p setting port, default 11211-u setting user-L setting listener host, 127.0.0.1 only native access, 0.0.0.0 full domain access-T set the number of threads, default to 4-c to maintain maximum number of connections, The default 10,241 hosts can serve memcached on multiple ports, and these memcached belong to different processes. Test Memcache Service
with Telnettelnet localhost {port_number}
with NCNC localhost {port_number}
with Python-memcachesudo apt-get install Pyhton-memcache >>>import memcache>>>mc=memcache. Clinet ([' 127.0.0.1:11212 ']) >>>mc.set (' key_1 ', ' value_1 ') true>>>mc.get (' key_1 ') ' Value_1 '
View status (Telnet, NC)Stats focuses on the maximum amount of memory that limit_maxbytes:memcached can use bytes: The amount of memory used by the current memcached evictions: The number of items kicked off by LRU Curr_items Current number of items Total_items total number of items see current Use memory Usage bytes limits_maxbytes ratio total_items Stats items Quit Quit check version number ========link some parameters: http://www.cnblogs.com/suger/archive/2011/09/06/2168319.html official documentation: https:// Github.com/memcached/memcached/blob/master/doc/protocol.txt
memcached configuration (beginner) and testing