memcached

cannot store values into memcache

China☆狼群 提交于 2019-12-31 03:37:06
问题 I am running apache+php+memcache on suse 10.1. I can connect Ok to memcached on port 11211, but I cannot do getVersion, add, get, etc. Error message: [Thu Jan 21 14:38:15 2010] [error] [client ] PHP Notice: Memcache::add() [function.Memcache-add]: Server localhost (tcp 11211) failed with: Failed reading line from stream (0) in /testmem/index.php on line 13 How can I debug this? 回答1: Try with 127.0.0.1. Make sure your firewall allows connecting to port 11211. Make sure your Memcached server is

yum 安装apache php 使php支持memcached扩展

為{幸葍}努か 提交于 2019-12-30 23:32:39
在公司上新项目的时候,无论生产环境还是测试环境,都会让运维安装php 环境(lamp/lnmp),并让php支持memcached 的扩展。这里搭建php环境其实主要就是搭建apache 和php。mysql一般都是用单独的数据库,不会再同一台服务器上的。看似简单的东西,在搭建的时候,还真是遇到了不少问题,以此记录,方便各位运维同学。 一.163和默认的镜像源有些包不能下载,使用阿里的镜像源 见本博客地址:http://www.cnblogs.com/lzcys8868/p/7532569.html 二. 必须安装 webtatic库 Centos 5.X rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm CentOs 6.x rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm CentOs 7.X rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 三. yum 安装httpd及其扩展 1.安装httpd及其扩展 yum –y install httpd

How to access memcache on App Engine Nodejs Standard

醉酒当歌 提交于 2019-12-30 17:39:40
问题 How does one access memcache from the nodejs standard environment? 回答1: The documentation apparently makes no reference to the App Engine memcache being available to the Node.JS standard environment, at least not at this time: there is no Node.JS language tab in the Memcache Overview page(s) there is no Caching Application Data section (under which the memcache-related docs exist for the other languages) under How-to Guides in the left-side navigation bar for Google App Engine Node.js

memcached: which is faster, doing an add (and checking result), or doing a get (and set when returning false)

匆匆过客 提交于 2019-12-30 09:09:10
问题 The title of this question isn't so clear, but the code and question is straightforward. Let's say I want to show my users an ad once per day. To accomplish this, every time they visit a page on my site, I check to see if a certain memcache key has any data stored on it. If so, don't show an ad. If not, store the value '1' in that key with an expiration of 86400. I can do this 2 ways: //version a $key='OPD_'.date('Ymd').'_'.$type.'_'.$user; if($memcache->get($key)===false){ $memcache->set(

increase item max size in memcached?

霸气de小男生 提交于 2019-12-30 06:02:50
问题 i am using memcached on my centos server , my project is large and has objects more than 1MB which i need to save to memcached , well , i can't ! because the max_item_size is 1MB , anyway to edit that ? Thank you 回答1: You can change the limit quickly by edit the configuration file [/etc/memcached.conf] adding: # Increase limit -I 128M Or if you have trouble with SO config run it with command line directly memcached -I 128M 回答2: If you are using Memcache >= 1.4.2, this is now configurable.

increase item max size in memcached?

这一生的挚爱 提交于 2019-12-30 06:02:27
问题 i am using memcached on my centos server , my project is large and has objects more than 1MB which i need to save to memcached , well , i can't ! because the max_item_size is 1MB , anyway to edit that ? Thank you 回答1: You can change the limit quickly by edit the configuration file [/etc/memcached.conf] adding: # Increase limit -I 128M Or if you have trouble with SO config run it with command line directly memcached -I 128M 回答2: If you are using Memcache >= 1.4.2, this is now configurable.

网站架构之缓存应用(摘录)

寵の児 提交于 2019-12-30 05:25:50
网站缓存这个话题并不新颖,但是能否将它用好,可是一门学问,同一件工具在不同人的手中会做出不同的事情来。这里我来分享总结下我对于网站架构中缓存应用的一些看法和经验,大家有好的想法可以补充 第一:缓存的一些基本概念。 1:缓存(CACHE)与缓冲(BUFFER)的区别,我认为缓存可以在某种程序上理解成一级缓存(Primary Cache),数据全局共享。缓冲则属于二级缓存,只对一部分对象共享数据,二级缓存在某种程序上主要是降低一级缓存组件的访问压力以及提高缓存的存取效率。 2:缓存的一些基本属性:命中率,表示缓存命中的次数/总的请求数,这是缓存设计的重要质量指标之一;缓存执行效率,例如GET,INSERT,DELETE等;容量,即缓存介质的容量最大值;成本,即开发成本,部署成本,软硬件成本。 3:缓存的问题,存储介质的选择往往左右缓存的设计,缓存在不命中时往往会使性能下降。 第二:网站中缓存的应用场景: 1:可以缓存整个页面的html,提高访问响应能力; 2:针对局部页面元素进行缓存; 3:对复杂数据的结果进行缓存,例如一个查询需要结合多个数据集,然后根据这些数据集进行相应的运算,即使每个子集查询有缓存,但还是需要额外的运算,这种情况可以考虑缓存计算后的结果。 4:对耗时的查询进行缓存,例如产品列表页的查询。 5:和上下文相关的用户数据,例如用户从订单埴写页进入到订单成功页

centos 7安装Memcache及其php拓展

我怕爱的太早我们不能终老 提交于 2019-12-30 00:51:52
Linux 下配置使用memcache功能,主要包括:安装libevent函数库、安装memcached、配置 PHP 扩展。 一、安装libevent函数库 libevent各版本地址: http://libevent.org/old-releases.html 在此我安装当前最稳定版本:libevent-2.0.21 1.下载并安装 [root@centos-7 ~]# wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz [root@centos-7 ~]# tar -zxvf libevent-2.0.21-stable.tar.gz [root@centos-7 ~]# cd libevent-2.0.21-stable [root@centos-7 libevent-2.0.21-stable]# ./configure --prefix=/usr/local/libevent [root@centos-7 libevent-2.0.21-stable]# make && make install (我安装到了/usr/local/libevent下) 2.检查是否安装成功: # ls -al /usr/local/libevent/lib | grep

windows 下安装memcache拓展

我们两清 提交于 2019-12-30 00:51:20
Windows下安装memcached (linux 接下来会继续 学习) 以管理员身份进入CMD 模式,具体方法:C:/windows/system32 管理员身份打开cmd.exe memcached -d install memcached -d start 运行 services.msc ,搜索memcached 服务已启动,则开启成功 或者 telnet localhost 11211 查看是否能正常连接。 1.下载php_memcache.dll 拓展包 网址:http://www.jb51.net/softs/392873.html 2.根据电脑配置选择拓展文件 我的电脑是 win 64 ,如果是wamp集成环境,根据集成环境的配置选择(如果电脑为64位,但集成环境是32位,则需要安装 添加32位拓展文件); ps: 关于文件选择:ts是指线程安全、nts是指线程不安全; 可以在phpinfo中的查找 Thread Safety项,若是enabled则为线程安全。可以在phpinfo中的查找 Thread Safety项,若是enabled则为线程安全。 3.php_memcache.dll 文件复制到php/ext 中,增加php.ini 配置(wamp集成环境中需要修改apache下的php.ini) extension=php_memcache.dll ; 4

windows下memcached安装以及php_memcache.dll扩展

回眸只為那壹抹淺笑 提交于 2019-12-30 00:50:57
http://kimi.it/258.html http://kimi.it/259.html https://www.cnblogs.com/elenaPeng/p/6877530.html https://blog.csdn.net/swjtu_yhz/article/details/60132572 http://php.net/manual/zh/book.memcache.php http://php.net/manual/zh/book.memcached.php http://pecl.php.net/package/memcache 1.Memcached下载链接 点击打开链接 安装步骤请参考: 安装步骤 2.安装php_memcache.dll扩展 由于本人是用的wamp下的环境,首先将php_memcache.dll文件放入wamp/bin/php/php5.5.12/ext/目录下,php_memcache.dll下载地址: 点击链接 php_memcache.dll 扩展文件: https://windows.php.net/downloads/pecl/releases/memcache/3.0.8/ (PS:一定要根据自己的php版本以及Thread Safety来下载相应的php_memcache.dll,Thread Safety可以在phpinfo