memcached

Error installing memcached gem on Snow Leopard - wrong architecture?

时光毁灭记忆、已成空白 提交于 2019-12-06 15:45:59
问题 I'm having an issue installing the memcached ruby gem on my Mac Pro machine with OS X Snow Leopard (10.6.4). Memcache is installed and working fine and for most projects I use the memcache-client gem without issue, but this current project I need to use the memcached gem instead. Installing the gem with env ARCHFLAGS='-arch x86_64' gem install memcached or just via the normal gem install memcached both give the same error when trying to run the application: (in /src/mojotech/projectr) dlopen(

高效缓存Memcached集成使用说明

冷暖自知 提交于 2019-12-06 15:34:03
Memcached 介绍与分析 Memcached 是一种集中式 Cache ,支持分布式横向扩展。总结几个它的特点来理解一下它的优点和限制。 Memory :内存存储,不言而喻,速度快,对于内存的要求高,不指出的话所缓存的内容非持久化。对于 CPU 要求很低,所以常常采用将 Memcached 服务端和一些 CPU 高消耗 Memory 低消耗应用部属在一起。(作为我们 AEP 正好有这样的环境,我们的接口服务器有多台,接口服务器对于 CPU 要求很高(由于 WS-Security ),但是对于 Memory 要求很低,因此可以用作 Memcached 的服务端部属机器) 集中式 Cache :避开了分布式 Cache 的传播问题,但是需要非单点保证其可靠性,这个就是后面集成中所作的 cluster 的工作,可以将多个 Memcached 作为一个虚拟的 cluster ,同时对于 cluster 的读写和普通的 memcached 的读写性能没有差别。 分布式扩展: Memcached 的很突出一个优点,就是采用了可分布式扩展的模式。可以将部属在一台机器上的多个 Memcached 服务端或者部署在多个机器上的 Memcached 服务端组成一个虚拟的服务端,对于调用者来说完全屏蔽和透明。提高的单机器的内存利用率,也提供了 scale out 的方式。 Socket 通信

Prevent cache miss warnings with perform_caching on

吃可爱长大的小学妹 提交于 2019-12-06 15:32:47
I'm experimenting with caching in my Rails 3.2 app and enabled caching by adding this to my development.rb file: config.action_controller.perform_caching = true Caching works as expected, except that when I load any page the console shows tons of these log entries: Completed 200 OK in 1006ms (Views: 249.2ms) cache: [GET /assets/jquery_ujs.js?body=1] miss cache: [GET /assets/chosen.jquery.min.js?body=1] miss cache: [GET /assets/bootstrap/bootstrap-tooltip.js?body=1] miss cache: [GET /assets/bootstrap/tabs.js?body=1] miss cache: [GET /assets/jquery-ui.js?body=1] miss cache: [GET /assets/jquery

How Spymemcache client use UDP?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 15:07:16
As it is seen that the Spymemcache client use TCP connection to connect with Memcached server as default. I want to use UDP instead of TCP. I think Facebook use UDP to get() requests from Memcached. Any one know how to use UDP with SpyMemcache ? 来源: https://stackoverflow.com/questions/24103977/how-spymemcache-client-use-udp

在windows安装memcache

白昼怎懂夜的黑 提交于 2019-12-06 14:45:20
linux下的Memcache安装: 1. 下载 memcache的linux版本 ,注意 memcached 用 libevent 来作事件驱动,所以要先安装有 libevent。 2. 安装 pecl::memcache。 用 pecl 命令行工具安装: pecl install memcache 或直接从源码安装: phpize ./configure make make install Windows下的Memcache安装: 1. 下载 memcache的windows稳定版 ,解压放某个盘下面,比如在c:\memcached 2. 在终端(也即cmd命令界面)下输入 ‘c:\memcached\memcached.exe -d install’ 安装 3. 再输入: ‘c:\memcached\memcached.exe -d start’ 启动。NOTE: 以后memcached将作为windows的一个服务每次开机时自动启动。这样服务器端已经安装完毕了。 4.下载 http://pecl4win.php.net/ext.php/php_memcache.dll ,请自己查找对应的php版本的文件 5. 在C:\winnt\php.ini 加入一行 ‘extension=php_memcache.dll’ 6.重新启动Apache,然后查看一下phpinfo

Memcached using more than max memory

孤人 提交于 2019-12-06 14:05:01
i have an installation on memcache which i want to use in my production environment but when i have ran a couple of tests it seems that memcache doesn't free up memory even after it has used up all of it allocated memory, Also i logged in and ran a flush_all command but the objects are still in the cache. Here are outputs from some tests memcached-tool memcache-top v0.6 (default port: 11211, color: on, refresh: 3 seconds) INSTANCE USAGE HIT % CONN TIME EVICT/s READ/s WRITE/s 127.0.0.1:11211 427.1% 0.0% 18 1.4ms 0.0 244 261.0K AVERAGE: 427.1% 0.0% 18 1.4ms 0.0 244 261.0K TOTAL: 4.3MB/ 1.0MB 18

Can memcached be used for locking?

守給你的承諾、 提交于 2019-12-06 13:56:54
问题 memcached can be used for a caching static data which reduces database lookup and typically does memcached.get(id) and memcached.set(id) . However is it fine to use this for locking mechanisms? Does memcache.set and memcached.get always give the data if it is present or will it just return None if the request is taking too much time? I want to avoid concurrent access to a particular resource identified by a id and I use this logic: def access(id): if memcache.get(id): return access else:

php ini change local value

微笑、不失礼 提交于 2019-12-06 13:27:14
I just setup php55 with apache on CentOS. I am also running Couchbase to handle memcached sessions. I have one server running fine. The other keeps trying to save php sessions locally. Not sure why. The php config has session.save_handler=memcached and session.save_path="cb.path:11211" The phpinfo page still lists the temp session path as the "local" option and the handler to files, but get_session_save_path() returns the couchbase url. How do I find where the local value is being set? Carter /etc/httpd/conf.d/php.conf had php_value declarations over writing the local variable. #php_value

How to get caches_action to set expires headers when there is a hit in memcached?

风流意气都作罢 提交于 2019-12-06 13:08:41
I have an action which I cache using caches_action :my_action, :expires_in=>1.hours and also set the expires headers in the action itself using def my_action ... expires_in 1.hours send_data(...,:disposition => 'inline',:type => 'image/png',:filename => params[:title]+".png") end However, when I look at the cache control response header from a result that is coming as the result of a memcached hit, I get this: Cache-Control: private, max-age=0, must-revalidate The first time round, i.e. when there is nothing in the cache, it is what I expect, i.e.: Cache-Control: max-age=3600, private It looks

upstream指令及负载均衡方式

帅比萌擦擦* 提交于 2019-12-06 13:03:51
UPSTREAM 语法: upstream name { ... } 默认值: — 上下文: http Defines a group of servers. Servers can listen on different ports. In addition, servers listening on TCP and UNIX-domain sockets can be mixed. 定义一组服务器。 这些服务器可以监听不同的端口。 而且,监听TCP和UNIX域套接字的服务器可以混用。 Example: upstream backend { server backend1.example.com weight=5; server 127.0.0.1:8080 max_fails=3 fail_timeout=30s; server unix:/tmp/backend3; server backup1.example.com backup; } By default, requests are distributed between the servers using a weighted round-robin balancing method. In the above example, each 7 requests will be distributed as