同为分布式缓存,为何Redis更胜一筹?

2018-3-26 杜世伟 架构

如今,市面上的缓存解决方案已经逐步成熟了,今天我将选取其中一些代表性的方案包括Redis、Memcached和Tair进行对比,帮助大家在生产实践中更好地进行技术选型。


一、常用的分布式缓存的对比


常用的分布式缓存包括Redis、Memcached和阿里巴巴的Tair(见下表),因为Redis提供的数据结构比较丰富且简单易用,所以Redis的使用广泛。



下面我们从9个大方面来对比最常用的Redis和Memcached。

阅读全文>>

标签: redis memcache tari

评论(0) 浏览(2037)

Linux下安装 Memcached服务器端

2015-5-27 杜世伟 memcache

#!/bin/sh

#Author  :  shiwei.du
#Date    :  2016/04/08


#install libevent
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/
make && make install
cd ..

阅读全文>>

标签: linux memcache memcached

评论(0) 浏览(13155)

php memcache类

2012-12-4 杜世伟 Php

<?php
/*
* 2012-12-04 14:54
* @author 孤独求学人
*/
class php_memcache{
   
protected $handle  = null;
protected $mem  = null;
private $host   = "";
private $port   = "";
private $timeout  = 0;
private $pconnect = false;
public function __construct($host = '127.0.0.1',$port='11211',$timeout=0,$pconnect=false){
  $this->host = $host;
  $this->port = $port;
  $this->timeout = $timeout;
  $this->pconnect = $pconnect;
  $this->mem     = new Memcache();
}

阅读全文>>

标签: PHP memcache

评论(0) 浏览(5345)

Powered by emlog 沪ICP备2023034538号-1