I. Introduction to Memcache: Memcache is a high-performance distributed memory object cache system. Maintain a large HashTable in the memory. Memcached manages this huge HashTable. Ii. Differences between Memcache and Memcached: Memcache is the software name, And Memcached is the name of the started process.
I. Introduction to Memcache: Memcache is a high-performance distributed memory object cache system. Maintain a large HashTable in the memory. Memcached manages this huge HashTable. Ii. Differences between Memcache and Memcached: Memcache is the software name, And Memcached is the name of the started process.
1. Introduction to Memcache
Memcache (memory, cache): a high-performance distributed memory object cache system. Maintain a large HashTable in the memory. Memcached manages this huge HashTable.
Ii. Differences between Memcache and Memcached
Memcache is the software name and Memcached is the name of the started process.
Iii. Working Principle of Memcache
Memcached runs on one or more servers as a daemon and receives client connections and operations at any time.
When memcache is not installed, the website works as follows: the browser accesses the server script, the server script accesses the database, and the processing is then output to the browser.
If your server is installed with memcache, after the first database query is executed, the server script stores the result set in the memcached memory cache, in the future, you can directly request from the memcached memory cache instead of querying the database, which greatly improves the efficiency.
4. Install the Memcache Server
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gztar -zxvf memcached-1.4.15.tar.gzcd memcached-1.4.15.tar.gz./configureMake && make install
5. Basic settings for Memcached server startup
For example, Memcahced-d-m 128-l 192.168.1.111-p 11211-u root
Below is a description of some Memcahced Parameters
-P memcached listening TCP port
-L connected IP address. The default value is local
-D run in daemon mode and put the program into the background
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB. The maximum value is 2 GB.
-An error is returned when M memory is used up, instead of deleting items.
-C: Maximum number of simultaneous connections. The default value is 1024.
-F block size growth factor, default value: 1.25
-N: minimum allocation space. The default value of key + value + flags is 48.
-H Show Help
Original article address: MemCache memory cache notes. Thank you for sharing them.