1. Basic concepts and principles Memcached is a high-performance distributed memory object cache system. It is actually a huge hash table maintained in the memory. Use Memcached: 2. use Telnet to operate memcached3.PHP to operate memcached1) Memcache2
1. Basic concepts and principles
Memcached is a high-performance distributed memory object cache system. It is actually a huge hash table maintained in the memory.
Memcached operation usage:
2. Telnet for memcached
3. PHP operations on memcached
1) Memcache
2) Memcached
4. memcached mechanism
Memcached is a c/s-based architecture and libevent-based event processing (fast response capability is maintained in the case of high concurrency ), built-in memory storage (uses the LRU algorithm to automatically delete older caches when data is full), client-based distributed.
5. memcached details
1) lifecycle
Data is destroyed from the time it is put into memcached until the time reaches. if the time is 0, the data will not expire.
2) how to put the session information in memcached
Configure php. ini as follows:
session.save_handler?=?memcache(d)session.save_path?=?“tcp://localhost:11211,tcp://localhost:9999”.
3) comparison between memcached and session:
Memcached is mainly designed to speed up, so it is a stateless data that is not bound to users.
Session data is bound to users, so it is stateful data.
4) security of memcached
Put it in the intranet, set the firewall to prevent others from accessing, and the memcached Port can only allow Intranet access.
5) which data is suitable for memcached:
Frequent and unstable changes and no real-time data warehouse receiving (online user status, online user count, etc)
6) memcached? And? Comparison of redis:
Different storage media
Lifecycle method
Different problems to be solved