search
HomeCommon ProblemWhat does Memcache mean?

What does Memcache mean?

Jun 24, 2020 pm 05:22 PM
memcache

Memcache is a free, open source, high-performance, distributed distributed memory object caching system. This system can improve the access speed of websites, especially for some large websites that require frequent access to databases. The improvement effect is very significant.

What does Memcache mean?

Why use Memcache?

Mainly used in dynamic web applications to reduce the load on the database.

It reduces the number of database reads by caching data and objects in memory,

thereby improving the speed of website access.

The implementation principle of Memcache

The atoms processed by memcache are each key and val. The key will be converted into a hash key through a hash table, which is convenient for search, comparison and matching. Hashing possible. At the same time, mem uses a two-level hash, which is maintained through a hash table.

Memcache has two core components: server and client

In a memcache component query, the client first determines the location of kv on the service side through the hash value of the key. When the server side determines Afterwards, the client will send a request to the server. Let it find the exact data, because there is no interaction or multicast protocol, so mem has minimal impact on the network

Memcache Features and Limitations

In There is no limit to the amount of item data that can be saved in Memcached, as long as there is enough memory.

The maximum memory used by a single Memcached process in a 32-bit system is 2G. If it is used in a 64-bit system, there is no limit. This is because the 32-bit system limits a single process to use up to 2G of memory. To use more memory, Multiple Memcached processes can be opened on multiple ports.

The maximum data expiration time is 30 days. If set to permanent, it will also expire at this time. Constant REALTIME_MAXDELTA

60*60*24* 30 control

The maximum key length is 250 bytes. If it is larger than this length, it cannot be stored. Constant KEY_MAX_LENGTH 250 control

The maximum data for a single item is 1MB. Data exceeding 1MB will not be stored. Constant POWER_BLOCK 1048576 Control,

It is the default slab size

The maximum number of simultaneous connections is 200, controlled through freetotal in conn_init(), the maximum number of soft connections is 1024, through

Settings.maxconns=1024 for control

Parameters related to space occupancy: settings.factor=1.25, settings.chunk_size=48, affecting slab data occupancy and stepping method

memcached is A non-blocking socket communication service based on the libevent library. Due to non-blocking communication, the memory reading and writing speed is very fast.

Memcached is divided into server and client. Multiple servers and clients can be configured. It is widely used in distributed services.

Memcached is very effective as a small-scale data distribution platform.

Memcached has a one-to-one correspondence between key and value. The default key size cannot exceed 128 bytes. The default value size is 1M, which is one slab. If you want to store 2M values ​​(continuous), you cannot use two Slabs, because the two slabs are not continuous and cannot be stored in the memory, the size of the slabs needs to be modified. When multiple keys and values ​​are stored, even if the slabs are not fully utilized, other data will not be stored.

memcached can already support language clients such as C/C, Perl, PHP, Python, Ruby, Java, C#, Postgres, Chicken Scheme, Lua, MySQL and Protocol.

Recommended tutorial: "PHP"

The above is the detailed content of What does Memcache mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor