What is Memcache?
Memcache is a high-performance distributed memory object caching system that can be used to store data in a variety of formats, including images, videos, files, and database retrieval results, by maintaining a unified, huge hash table in memory. The simple thing is to call the data into memory and read it from memory, which can greatly improve the reading speed (from 36,000 section)
It is equivalent to a memory database that can reduce operations on the database.
It was initially seen in a PHP interface server in the company.
Installation:
How to install in Ubuntu: Digging pits (the next time you fill in the procedure forgot)
Apt-get Install memcached
After installation.
sudo memcached start start
/ETC/MEMCACHED.CONF is the default configuration file
-P Listening Port
-L connected IP address, default is native
-D Start memcached service
-D Restart Restart memcached service
-D Stop|shutdown Close the running memcached service
-D Install memcached service
-d Uninstall Uninstall memcached service
-U Run as (only valid when running as root)
-m maximum memory usage, in megabytes. Default 64MB
-M running out of memory and returning an error instead of deleting an item
-c Maximum number of simultaneous connections, default is 1024
-F Block size growth factor, default is 1.25-n minimum allocation space, key+value+flags default is 48
-h Display Help 2) Installing the Memcache client
PHP memcache Module Installation Method:
sudo apt-get install Php5-memcache
How to use: PHP manual with the use of the module instructions
Python: module https://pypi.python.org/pypi/python-memcached
Import Memcache mc = Memcache. Client ([' 127.0.0.1:11211 ']) mc.set (' Hello ', ' World ') mc.get (' Hello ')
Some notes:
Memcached does not have a security certificate, so if the configured-L listening IP is local to the IP may cause data security issues
Later with the familiar again pits
Use of Memcache