memcached

Getting Error 324 (net::ERR_EMPTY_RESPONSE). when using memcache in kohana

拈花ヽ惹草 提交于 2019-12-19 19:44:39
问题 i'm getting this error when i try to use memcache using kohana. all i did was changed the hostname in the configuration file and used $cache = Cache::instance('memcache'); . i can telnet my memcached servers so probably the problem is not there. any help? 回答1: The error described is a Google Chrome error. This suggests that Kohana is not responding with anything, most likely because the error/exception handling is being suppressed. Check that PHP error_reporting is on ( E_ALL is a good value)

memcache在大型网站的应用策略

北战南征 提交于 2019-12-19 17:29:48
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 【部署策略】     基于memcached的slab和dump的内存管理方式,它产生的内存碎片比较少,不需要OS去做繁杂的内存回收,所以它对CPU的占用率那是相当的低。所以建议将它跟占用CPU较高的WEB服务器一起使用来节省成本。当然如果你有大量的廉价PC,那用来专门做memcached服务器也不错。由于32位操作系统中,每个进程最多只能使用2GB内存,所以如果你有大内存的话,可以以daemon的方式启动两个以上的memcached服务,或者干脆用64位的CPU和OS。 【服务监控】      memcached支持分布式机制,php通过memcache::addserver来实现该机制,它实现了如果服务器列表中的一台down掉的时候在参数retry_interval指定的时间就不会再连接该服务器的机制。所以只要你在该时间段内重启或者修复了该服务器,则不会对前端造成太大的影响。当然了,如果你一直不去重启该服务器的话,我测试过addserver再次连接一台down掉的服务器的时间将比平时延长了1秒的时间。可以通过addserver的最后一个参数failure_callback定义一个回调函数来实现邮件通知或者短信通知管理员的功能。     如果是手工重启,我建议将该值设置为20分钟

memcached页面级缓存存在的问题

老子叫甜甜 提交于 2019-12-19 17:29:30
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> memcached实现了页面级缓存,根据查询条件跟分页参数生成唯一key,无规律的,缓存页面数据 存在问题:由于根据查询条件缓存与分页查询缓存的key值是根据查询条件得到的哈希值,没有规矩,导致用户在更改数据(比如修改商品价格)时无法同步更新缓存的value值,会访问到脏数据。 一种解决方案,通过时间戳来判断是否需要更新,在用户增删改的时候记录一个时间用来对比缓存生成的时间,如果修改的时间戳大于缓存生成的时间戳,强制更新缓存. 如果有更好的解决办法,会回来更新此博文! 来源: oschina 链接: https://my.oschina.net/u/938800/blog/296778

用memcached做实时分页缓存

末鹿安然 提交于 2019-12-19 14:07:55
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 用 memcached 做分页缓存,可能很多人会觉得麻烦而不用。因为在增加、修改、删除的过程中,你不知道会影响到哪些数据,而如果把所有分页相关的数据缓存都删除并重新生成一遍,实现又很麻烦,甚至不可行,所以干脆就用 mysql 直接分页,简单方便,但是这样性能却也下降了。 本章就讲一个简单的实现用 memcached 做分页缓存的方法。 首 先假使我们有一个文章页需要做分页显示,分页类型有按分类分页,按最新分页,按热点分页,按自定义方式分页,等等。这就出现了一个比较棘手的问题,我们对 数据的更新影响到哪些分页我们是不可知的,不知道需要删除哪些相关的缓存。你可能会想,更新数据时删除所有类型分页的缓存不就好了。那我问你,有多少种分 页类型,每个类型各有多少页, key 的组成方式各是什么,如果分页带有其他 get 查询参数,你怎么知道 get 都传递了哪些值,不知道这些,你怎么删除全部分页缓存。 讲到这里,你可能会觉得有点失望吧,不是吗,没想到用 memcached 做 分页缓存原来这么麻烦。那么,有没有简单的解决方案?答案是肯定的,请相信,我写这篇文章的目的,就是来告诉你一个简单的解决方案来的。说了这么多,其实 我们需要解决的核心问题就只有一个,我们增加、修改、删除文章数据时,能够让分页的缓存都失效

memcached-like key/value cache that uses both RAM and disk [closed]

送分小仙女□ 提交于 2019-12-19 07:28:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have a java web app that makes back-end use of a third-party web service. Calling the web service creates latency, which is important to avoid whenever possible. Also, my app is only allowed to make a certain

How to get the size of a python object in bytes on Google AppEngine?

£可爱£侵袭症+ 提交于 2019-12-19 03:18:47
问题 I need to compute the sizes of some python objects, so I can break them up and store them in memcache without hitting size limits. ' sizeof ()' doesn't seem to be present on python objects in the GAE environment and sys.getsizeof() is also unavailable. GAE itself is clearly checking sizes behind the scenes to enforce the limits. Any ideas for how to accomplish this? Thanks. 回答1: memcache internally and invariably uses pickle and stores the resulting string, so you can check with len(pickle

Finding AWS ElastiCache endpoints with Java

跟風遠走 提交于 2019-12-19 02:59:09
问题 I'm trying to programmatically get a list of ElastiCache endpoints from my Java app using the latest Java AWS SDK. Things don't seem to be working - I can find a valid CacheCluster, but then when I list its nodes, it's empty. Here's my code: CacheCluster cc = it.next(); System.out.println("Cache node type: " + cc.getCacheNodeType()); System.out.println("Number cache nodes: " + cc.getNumCacheNodes()); List<CacheNode> listCache = cc.getCacheNodes(); System.out.println("List size: " + listCache

Can I use Amazon Elasticache on Heroku?

血红的双手。 提交于 2019-12-18 20:48:14
问题 I am currently using Heroku's Memcached in a Rails 3 app and would like to move over to Elasticache because the pricing is much more favorable. Is this possible? Is the configuration relatively straightforward? Is there anything that I should be aware of as regards the performance? 回答1: Note: While this does work, @btucker pointed out that it allows any Heroku-hosted app to access your ElastiCache cluster. I do not recommend using this solution. Yes you can. The setup is similar to the guide

Memcached 未授权访问漏洞 CVE-2013-7239

自作多情 提交于 2019-12-18 17:43:31
0x00 漏洞简介 漏洞简述Memcached 是一套分布式高速缓存系统。它以 Key – Value 的形式将数据存储在内存中。这些数据通常是会被频繁地应用、读取的。正因为内存中数据的读取速度远远大于硬盘的读取速度所以可以用来加速应用的访问。 由于 Memcached 的安全设计缺陷客户端连接 Memcached 服务器后无需认证就可读取、修改服务器缓存内容。 影响范围:Memcached 全版本 0x01 环境搭建 测试机:Ubuntu216.04 靶机:Ubuntu16.04 Memcache:v1.4.5 1、安装Memcache服务端 apt-get install memcached 2、启动服务 memcached -d -m 128 -p 11211 -u root 3、查看是否启动了服务 ps -ef | grep memcache 4、安装客户端(可省略) apt-get install php-memcached 5、重启一下apache服务 service apache2 restart 0x02 漏洞证明 1、`netstat -an |more`命令查看端口监听情况 回显 0.0.0.0:11211 表示在所有网卡进行监听,存在Memcached未授权访问漏洞。 2、在Ubuntu2输入 telnet 192.168.246.130 11211

Convert buffer to array

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 14:15:29
问题 I am setting memcached with $memcached->set("item" , ["1" => "hello"]); anything work in PHP , In Node.js with memcached plugin , I get a buffer instead of array in result <Buffer 61 3a 25 61 34 3a> I can not convert such buffer to array In Node.js : memcached.get("item" , function(err, data) { console.log(data); } Do you have any way ? 回答1: arr = [...buffer] ES6 introduced a lot of other features, besides buffers. You can even easily append like this: arr.push(...buffer) The ... operator