Tag:memcached

  • 2016Django uses memcached as a cache

    Time:2022-11-27

    With memcached as a cache, the speed of django is like flying Install sudo apt-get install memcached pip install python-memcached sudo apt-get install python-dev sudo apt-get install libmemcached-dev pip install pylibmc configuration CACHES = { ‘default’: { ‘BACKEND’: ‘django_pylibmc.memcached.PyLibMCCache’, ‘LOCATION’: ‘localhost:11211’, ‘TIMEOUT’: 500, ‘BINARY’: True, ‘OPTIONS’: { # Maps to pylibmc “behaviors” ‘tcp_nodelay’: True, ‘ketama’: […]

  • Memcached Basic Notes

    Time:2022-11-26

    [Notes] Memcache Basics Introduction to Memcache What is Memcache Memcache is a distributed cache system, Distributed: By installing Memcache service in multiple operating systems at the same time, a good cluster effect can be achieved. High speed: All data in Memcache is maintained in memory. What is Memcache good for? when appliedViewsWhen it is particularly […]

  • How to prevent a slow query from blowing up the server

    Time:2022-11-25

    Hey? xxx? What happened to your service, the machine is down again~!ah? How many units have been hung up?Two of the 40 you borrowed have been hung up!Wait a minute, let me see what’s going on! The server is smoking again~~~ The reason is this: Some time ago, the project ushered in the peak of […]

  • memcache operation class

    Time:2022-11-24

    1. Sample code <?php namespace Common\Drive; use \Memcache; /** * Memcache cache operation class */ class Mcache { protected static $_instance = null; private $mcache; const CACHE_KEY = ‘userinfo’; /** * Singleton instance * * @return Object */ public static function getInstance($dbHost, $port) { if (self::$_instance === null) { self::$_instance = new self($dbHost, $port); } […]

  • Exploring the reasons why PHP’s memcache extension and memcached extension read and write arrays are incompatible

    Time:2022-11-23

    background Recently, many teams in the company have upgraded php7. Currently, the only extension that supports php7 to read mc is memcached.However, many projects in the company share a mc cluster to access user session data. When saving, it is written in the form of an array with the memcache extension when logging in. When […]

  • thinkphp 3.2 redis memcache call method

    Time:2022-11-22

    1.redis /** * test redis */ public function redis() { $redis = new \Redis(); $connect = $redis->connect(‘127.0.0.1’,6379); $set = $redis->set(‘test’,’hello world!’); $get = $redis->get(“test”); var_dump($redis); var_dump($connect); var_dump($set); var_dump($get); } 2.memcache public function memcache() { $arr = array( ‘host’=>’127.0.0.1’, ‘port’=>’11211’, ); $Memcache = new Memcache($arr); $is = $Memcache->set(‘121′,’maomao’); $get = $Memcache->get(‘121’); var_dump($get); }

  • Memcached principle of study notes

    Time:2022-11-21

    0x00 Brief introduction of Memcached Memcached is a high-performance distributed memory object caching system, which is used to reduce database load and improve performance in dynamic systems. 0x01 Memcached features Event processing based on libevent Built-in memory storage method SLab Allocation mechanism Not a single data deletion mechanism client-based distributed system 0x02 The basis of […]

  • When running and testing the Memcached cache data function under IDEAL, the cache time expires

    Time:2022-11-20

    Environmental information:1. A machine (native) running win7 64-bit system, with ideal 14 IDE installed, with JDK1.8 and JDK1.62. A memcached server, linux suse 64-bit system, JDK1.6 Question details:Use JAVA code Memcached to cache data, whether it is through set(key, value, seconds) or set(key, value, expirationDate), there are problems (either it returns null as soon as […]

  • Python-Django-memcached

    Time:2022-11-19

    Documentation Pseudocode given a URL, try finding that page in the cache if the page is in the cache: return the cached page else: generate the page save the generated page in the cache (for next time) return the generated page Install After installing Memcached itself, you’ll need to install a Memcached binding. There are […]

  • Memcache basics

    Time:2022-11-18

    overview Memcache is a project of danga.com. It was originally used to serve LiveJournal. At present, many people around the world use this cache project to build their own websites with heavy loads to share the pressure of the database.It can handle any number of connections, using non-blocking network IO. Because its working mechanism is […]

  • Related operations of memcached

    Time:2022-11-17

    1. Connect memcached: 2. View cached items: 3. Check the key according to the slab id (the number behind the items) 4. View the content according to the key:

  • Distributed memory cache system design

    Time:2022-11-16

    1. Problem With the expansion of user scale and the continuous addition of functions on any platform, the read and write pressure on the persistent database layer will increase. Once the database is under too much pressure, the read and write performance will drop sharply, and in severe cases, it will lead to a large […]