Memcache Introduction
In high concurrency environment, a large number of read and write requests rushed to the database, the disk processing speed and memory is obviously not a magnitude, from reducing the pressure of the database and improve the response speed of the system to consider, generally in the database before adding a layer of cache. Because of the limited memory resources and carrying capacity of a single machine, and the large use of local cache, the same data can be stored multiple copies of different nodes, resulting in a significant waste of memory resources, thus generating a distributed cache.
Memcache is a danga.com project, it is an open source high-performance distributed memory object cache system, early to LiveJournal2 services, and later gradually by more and more large web sites used to reduce access to the database in the application, Increase your app's access speed and reduce the load on your database.
In order to provide high-speed data discovery capabilities in memory, Memcache stores and accesses data in key-value form, maintaining a huge HashTable in memory, which reduces the time complexity of data queries to O (1), guaranteeing high-performance access to data. Memory space is always limited, when memory does not have more space to store new data, Memcache will use the LRU (Least recently used) algorithm, nearly infrequently accessed data is eliminated, in order to make room for new data storage. Memcache storage supported data formats are also flexible, through the object serialization mechanism, you can convert higher-level abstract objects into binary data, stored in the cache server, the current end of the application needs, and can be deserialized through binary content, the data is restored to the original object.
Download and install
Link: Http://pan.baidu.com/s/1pJMkxsR Password: HRQT
Link: Http://pan.baidu.com/s/1qWoYv7I Password: Crh8 (msvcr71.dll)
Use administrator privileges to enter the "x:/memcached/memcached.exe-d Install" installation under CMD.
The installation prompts for the missing msvcr71.dll download-related DLLs are copied to the C:/windwos/system32, and 64-bit is copied to c:/windows/syswow64.
Input: "x:/memcached/memcached.exe-d start" starts, the default listening port is 11211.
With Memcached.exe-h you can view its help, view the Memcache status, telnet to local IP address 11211. Enter Stats query status
The-D option is to start a daemon
The amount of memory used by-m allocated to memcache, in megabytes
-U user running Memcache
-L Listener Server IP address
-P Set memcache listening port, preferably more than 1024 ports
-C Maximum number of concurrent connections running, default is 1024
-p Settings Save memcache pid file
Installing the class library with NuGet enyimmemcached
Distributed Cache (i)