


Memcached PHP module memcache and memcached difference analysis
1. Currently, most PHP environments use the memcache version without d. This version was released earlier and is a native version developed entirely within the PHP framework. The corresponding memcached with d is based on libmemcached, so relatively speaking, the memcached version has more complete functions.
memcache:http://cn2.php.net/manual/en/book.memcache.php
memcached:http://cn2.php.net/manual/en/book.memcached.php
2.Memcache is native It is implemented to support the coexistence of both OO and non-OO interfaces. Memcached uses libmemcached and only supports OO interface.
3. Another very commendable thing about memcached is that the flag is not set during operation, but has a unified setOption(). Memcached implements more of the memcached protocol.
4.memcached supports Binary Protocol, but memcache does not. This means memcached will have higher performance. However, memcached does not currently support long connections.
There is a table below to compare the PHP client extension memcache and memcached
http://code.google.com/p/memcached/wiki/PHPClientComparison
Another point that everyone is more concerned about is the algorithm used. Everyone knows that the "consistent hash algorithm" is an algorithm that has less impact on the data stored on memcached when storage nodes are added or deleted. Then this algorithm can be used in both extension libraries of PHP, but the setting method is different.
Memcache
Modify php.ini and add:
[Memcache]
Memcache.allow_failover = 1
…
…
Memcache.hash_strategy =consistent
Memcache.hash_function =crc32
…
…
or use ini_ in php set Method:
Ini_set('memcache.hash_strategy','standard');
Ini_set('memcache.hash_function','crc32');
Memcached
$mem = new memcached();
$mem->setOption(Memcached ::OPT_DISTRIBUTION,Memcached::DISTRIBUTION_CONSISTENT);
$mem->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE,true);
The above introduces the analysis of the difference between Memcached php module memcache and memcached, including the content of Memcached. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Memcached is a commonly used caching technology that can greatly improve the performance of web applications. In PHP, the commonly used Session processing method is to store the Session file on the server's hard disk. However, this method is not optimal because the server's hard disk will become one of the performance bottlenecks. The use of Memcached caching technology can optimize Session processing in PHP and improve the performance of Web applications. Session in PHP

Caching library in PHP8.0: Memcached With the rapid development of the Internet, modern applications require efficient and reliable caching technology to improve performance and handle large amounts of data. Due to PHP's popularity and open source nature, the PHP caching library has become an essential tool in the web development community. Memcached is a widely used open source high-speed memory caching system that can handle millions of simultaneous connected cache requests and can be used in many different types of applications, such as social networks, online

With the development of the Internet, PHP applications have become more and more common in the field of Internet applications. However, high concurrent access by PHP applications can lead to high CPU usage on the server, thus affecting the performance of the application. In order to optimize the performance of PHP applications, Memcached caching technology has become a good choice. This article will introduce how to use Memcached caching technology to optimize the CPU usage of PHP applications. Introduction to Memcached caching technology Memcached is a

With the rapid development of the Internet, large-scale MySQL database backup and recovery has become one of the essential skills for major enterprises and websites. With the widespread application of Memcached, how to back up and restore Memcached has also become an important issue. As one of the main languages for web development, PHP has unique advantages and skills in handling backup and recovery of MySQL and Memcached. This article will introduce in detail the implementation method of PHP processing MySQL and Memcached backup and recovery.

With the continuous increase of network applications and the continuous expansion of data volume, data reading and writing efficiency has become one of the important factors affecting application performance. The application of caching technology can solve this problem well. In PHP applications, Memcached is the most commonly used cache server. Memcached is a high-performance distributed memory object caching system that can store commonly used data in memory and improve the efficiency of data retrieval. This article will introduce how to use PHP and Memcached for cache management, and how to optimize

With the continuous development of Internet technology, audio and video resources have become a very important form of content on the Internet, and PHP, as one of the most widely used languages in network development, is also constantly used in the field of video and audio playback. However, with the increasing number of users of audio and video websites, many websites have discovered a problem: under high concurrency conditions, PHP's processing speed of audio and video slows down significantly, resulting in problems such as inability to play in time or stuck playback. To solve this problem, Memcached caching technology should

With the rapid development of modern Internet applications, user experience is crucial to the success of an application. How to ensure high performance and high availability of applications has become one of the important issues that developers need to solve. As one of the widely used programming languages, PHP's performance monitoring and optimization are also very important. Memcached is a high-performance, distributed memory object caching system that can help applications improve performance and scalability. This article will introduce how to use PHP and Memcached to implement performance monitoring.

With the rapid growth of modern applications, caching has become a vital part of many developers. Caching can greatly improve application performance and reduce server load. In CakePHP, one way to implement caching is to use Memcached. Memcached is a memory-based distributed caching system. It stores data in memory and can read and write data quickly. In a multi-server environment, Memcached can store data in a distributed manner and share it over the network. not only can
