memcached

nginx+memcached+memcached-session-manager

ⅰ亾dé卋堺 提交于 2019-12-05 09:12:28
大家好,很久没写东西了。之前有写过一点,有点烂,之后气馁了;现在还是要重拾这份留下记忆的习惯;这篇文章会少量链接到相关讲的更详细的地方;我只是讲一下我在构建环境时所遇到的问题和流程;大家能够共同进步;闲话少说,进入正题; 本机的虚拟机:VMwarec centos release 6.3; 1 什么是nginx? nginx是一个小巧而高效的Linux下的web服务器软件。开发人员 Igor Sysoev 来自俄罗斯,nginx的话其实已经在一些俄罗斯的大型网站上运行多年,相当的稳定,最近才在美国开始知名起来。具体详情 请点这 1.1 nginx安装所需的包: 1、zlib-1.2.8.tar.gz 下载:wget http://zlib.net/zlib-1.2.8.tar.gz 2、openssl-1.0.1e.tar.gz 下载:wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz 3、pcre-8.34.tar.gz 下载:wget http://sourceforge.net/projects/pcre/files/pcre/8.34/pcre-8.34.tar.gz/download 4、nginx-1.5.11.tar.gz 下载:wget http://nginx.org/download/nginx-1

How to cache an arbitrary object in Rails(time-based)?

妖精的绣舞 提交于 2019-12-05 08:57:14
I read the official guide. It says there are page cache , action cache and fragment cache , but they are not what I want. I just like to cache an object, not the whole page or fragment of view, like this pseudocode: def show cache @ads, :expires_in => 1.hour do @ads = Advertisement.all do end Is it possible? with memcache or redis ? Try this: #To cache the object Rails.cache.write('cache-key', object) #Load the object from the cache Rails.cache.read('cache-key') Check out the lawnchair gem to cache objects in Redis. 来源: https://stackoverflow.com/questions/8236637/how-to-cache-an-arbitrary

docker 安装 memcached

折月煮酒 提交于 2019-12-05 08:43:27
$ # install the memcached $ docker run -i -t ubuntu:12.04 apt-get -y install memcached $ # use docker ps -a to find the container_id $ docker ps -a $ # commit the container $ docker commit container_id lmj/memcached $ # run it $ docker run -d -p 11211 lmj/memcached memcached -u daemon $ # show the expose port $ docker port container_id 11211 $ # show the container info $ docker inspect container_id 来源: oschina 链接: https://my.oschina.net/u/104141/blog/151755

Django-nonrel ≤1.3 and Memcache on Google App Engine

拥有回忆 提交于 2019-12-05 08:15:57
I'm a designer still trying to code up my first app in Google App Engine as an experiment. I have got to the point where I want to set up memcache to cache my entire site following the instructions at: http://docs.djangoproject.com/en/dev/topics/cache/#memcached I am clear that I need to add in my settings.py the following: CACHE_BACKEND = 'memcached:// [IP ADDRESS] : [PORT] /' And then: MIDDLEWARE_CLASSES = ( 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', ) CACHE_MIDDLEWARE_SECONDS=60*2 This

Redis面试50题

空扰寡人 提交于 2019-12-05 07:37:31
1、什么是Redis? Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库统统加载在内存当中进行操作,定期通过异步操作把数据库数据flush到硬盘上进行保存。因为是纯内存操作,Redis的性能非常出色,每秒可以处理超过 10万次读写操作,是已知性能最快的Key-Value DB。 Redis的出色之处不仅仅是性能,Redis最大的魅力是支持保存多种数据结构,此外单个value的最大限制是1GB,不像 memcached只能保存1MB的数据,因此Redis可以用来实现很多有用的功能,比方说用他的List来做FIFO双向链表,实现一个轻量级的高性 能消息队列服务,用他的Set可以做高性能的tag系统等等。另外Redis也可以对存入的Key-Value设置expire时间,因此也可以被当作一 个功能加强版的memcached来用。 Redis的主要缺点是数据库容量受到物理内存的限制,不能用作海量数据的高性能读写,因此Redis适合的场景主要局限在较小数据量的高性能操作和运算上。 2、Redis相比memcached有哪些优势? (1) memcached所有的值均是简单的字符串,redis作为其替代者, 支持更为丰富的数据类型 (2) redis的速度比memcached快很多 (3) redis可以持久化其数据 3、Redis支持哪几种数据类型

Rails, Passenger and Memcached: Unable to find server during initialization

三世轮回 提交于 2019-12-05 07:17:21
I hope someone can help me with a problem that I am certain is a user error. The configuration details below work in all my other environments including integration, development and qa. However, the production servers give the following error: <ActionController::Session::MemCacheStore:0x2b45f6acb248> unable to find server during initialization. When I telnet to the memcached box from the server having the problem and run 'stats', I get: STAT pid 16136 STAT uptime 7398638 STAT time 1275059978 STAT version 1.2.8 STAT pointer_size 64 STAT rusage_user 7.085922 STAT rusage_system 13.275981 STAT

Windows下的Memcache安装与测试教程

僤鯓⒐⒋嵵緔 提交于 2019-12-05 07:13:17
Windows下的Memcache安装 1、下载memcache for windows。 下载地址:http://splinedancer.com/memcached-win32/,推荐下载binaries版本, 解压(本例中解压到e:memcached-1.2.4)。 2、安装memcache, 在命令行状态下输入: e:/memcached-1.2.4/memcached.exe -d install 。至此memcached已经安装成windows服务 3、启动memcache, 在命令行下输入: e:/memcached-1.2.4/memcached.exe -d start 以启动memcached服务。 或者也可以选择在windows服务中启动 到此,memcache的服务器端就准备完毕,接下来需要安装php的memcache扩展, php 安装Memcached模块支持 1、下载php_memcache.dll模块, 你可以从http://downloads.php.net/pierre/找到对应的版本, php5.3对应 php_memcache-2.2.6-5.3-vc9-x86.zip 将php_memcache.dll放到php\ext目录下, 2、修改php.ini来加入扩展,并并重启apache服务器 加入extension=php_memcache

linux安装memcached服务

时光总嘲笑我的痴心妄想 提交于 2019-12-05 07:12:42
1. 准备安装文件 下载memcached与libevent的安装文件 libevent-2.0.21-stable.tar.gz memcached-server-1.4.31.tar.gz 2. 具体安装步骤 1.由于memcached依赖于libevent,因此需要安装libevent。由于linux系统可能默认已经安装libevent,执行命令: rpm -qa|grep libevent 查看系统是否带有该安装软件,如果有执行命令: rpm -e libevent-1.4.13-4.el6.x86_64 --nodeps(由于系统自带的版本旧,忽略依赖删除) 3. 安装libevent命令: [root@localhost mysoft]# tar -zxvf libevent-2.0.21-stable.tar.gz [root@localhost mysoft]# cd libevent-2.0.21-stable [root@localhost libevent-2.0.21-stable]# ./configure --prefix=/usr/local/libevent [root@localhost libevent-2.0.21-stable]# make [root@localhost libevent-2.0.21-stable]# make

3000 字详解 Kylin 查询缓存重构

自古美人都是妖i 提交于 2019-12-05 06:59:17
在过去,由于粗粒度缓存过期策略和外部缓存的缺乏,查询缓存在 Kylin 中的使用效率不高。由于激进的缓存过期策略,有用的缓存经常被不必要地清理。因为查询缓存存储在本地服务器中,它们因而不能在服务器之间共享。同时,由于本地缓存的大小限制,并不是所有有用的查询结果都可以被缓存。 针对这些不足,我们使用签名检查来实现新的查询缓存失效策略,并引入 memcached 作为 Kylin 的分布式缓存,使 Kylin 服务器能够在服务器之间共享缓存。同时添加 memcached 服务器来扩展分布式缓存也是很容易的。 这些功能由 eBay Kylin 团队提出和开发,在此非常感谢他们的贡献。 相关的 JIRA KYLIN-2895 Refine Query Cache: https://issues.apache.org/jira/browse/KYLIN-2895 KYLIN-2899 Introduce segment level query cache:https://issues.apache.org/jira/browse/KYLIN-2899 KYLIN-2898 Introduce memcached as a distributed cache for queries:https://issues.apache.org/jira/browse/KYLIN-2898 KYLIN

Memcached set() fails: WRITE FAILURE

99封情书 提交于 2019-12-05 06:40:35
问题 So Memcached fails to write certain keys, getResultMessage() says WRITE FAILURE I'm using this in setup: $this->mmcache = new Memcached(); $this->mmcache->addServer('localhost',11211, 100); $this->mmcache->setOption(Memcached::OPT_BINARY_PROTOCOL, true); $this->mmcache->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_IGBINARY); $this->mmcache->setOption(Memcached::OPT_COMPRESSION, false); Some keys work every time, some fail everytime. I even tried base64 encoding the keys but they