memcached

Migrating Memcached client from Memcached-Java-Client to Xmemcached

孤街浪徒 提交于 2020-01-02 16:19:10
问题 I have an old memcached client implementation that is based of the danga client, but was slightly modified. I think this client is now called Memcached-Java-Client. The implementation I have at hand is old, unmaintained, and seem to be bogus. I need to migrate the client to a newer client with the following constraints: I need the new client hashing algorithm to be compatible with the old one. If this constraint is not met, we will have to make the site (at least partially) unavailable for a

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

坚强是说给别人听的谎言 提交于 2020-01-02 11:27:00
问题 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

PHP Memcache connects to couchbase but can't do anything else

本秂侑毒 提交于 2020-01-02 10:32:28
问题 I have a new CouchBase server set up on Windows 7, and Apache with PHP and php_memcache.dll configured correctly. I can connect to the server, but cannot get stats, or set any values. Any suggestions what I am doing wrong? I've turned the firewall off, but as I can connect to 11211, I think connectivity is OK, anyway? Here's a test script $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); var_dump($memcache); echo "<hr />"; $allSlabs = $memcache-

PHP Memcache connects to couchbase but can't do anything else

那年仲夏 提交于 2020-01-02 10:31:59
问题 I have a new CouchBase server set up on Windows 7, and Apache with PHP and php_memcache.dll configured correctly. I can connect to the server, but cannot get stats, or set any values. Any suggestions what I am doing wrong? I've turned the firewall off, but as I can connect to 11211, I think connectivity is OK, anyway? Here's a test script $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); var_dump($memcache); echo "<hr />"; $allSlabs = $memcache-

Pyramid with memcached: how to make it work? Error - MissingCacheParameter: url is required

随声附和 提交于 2020-01-02 08:29:47
问题 I have site on Pyramid framework and want to cache with memcached. For testing reasons I've used memory type caching and everything was OK. I'm using pyramid_beaker package. Here is my previous code (working version). In .ini file cache.regions = day, hour, minute, second cache.type = memory cache.second.expire = 1 cache.minute.expire = 60 cache.hour.expire = 3600 cache.day.expire = 86400 In views.py: from beaker.cache import cache_region @cache_region('hour') def get_popular_users(): #some

ASP.NET性能优化之分布式Session

点点圈 提交于 2020-01-02 08:13:50
如果我们正在使用Session,那么构建高性能可扩展的ASP.NET网站,就必须解决分布式Session的架构,因为单服务器的SESSION处理能力会很快出现性能瓶颈,这类问题也被称之为Session同步。微软有自己的分布式Session的解决方案,那就是SessionStateServer,我们可以参考: ASP.NET Session State Partitioning http://blog.maartenballiauw.be/post/2008/01/23/ASPNET-Session-State-Partitioning.aspx ASP.NET load balancing and ASP.NET state server http://blog.maartenballiauw.be/post/2007/11/ASPNET-load-balancing-and-ASPNET-state-server-(aspnet_state).aspx 不过本文是要换一个方案,那就是使用Memcached来到达分布式SESSION的架构。Memcached作为分布式的缓存服务器已经被广泛应用在网站建设中。 一:Session的机制 Session是针对用户的,我们也可以理解为是针对浏览器的。在浏览器首次访问ASP.NET网页的时候(网页没有关闭session功能)

Why is file_get_contents faster than memcache_get?

浪子不回头ぞ 提交于 2020-01-02 02:17:09
问题 I'm loading XML files from disk using file_get_contents, and as a test I find I can load a 156K file using file_get_contents() 1,000 times in 3.99 seconds. I've subclassed the part that does the loading and replaced it with a memcache layer, and on my dev machine find I can do 1000 loads of the same document in 4.54 seconds. I appreciate that file_get_contents() will do some caching, but it looks like it is actually faster than a well-known caching technique. On a single server, is the

PHP Extension (memcache|memcached) not showing in phpinfo() but showing in php -m and php -i?

纵然是瞬间 提交于 2020-01-01 10:50:18
问题 I am getting both modules listed as installed / configured when I use: php -m or if I use: php -i but when I use: $m = new Memcache; // or $m = new Memcache(); // or $m = new Memcached(); //or $m = new Memcached; I get the following error: Fatal error: Class 'Memcached' not found I am running on a Mac - OS X (10.5.7) with default install of apache & php. Additionally, I have memcached running as a daemon on 127.0.0.1:11211 and libmemcache as required by the php-memcached library. I have

Persistent multiprocess shared cache in Python with stdlib or minimal dependencies

拥有回忆 提交于 2020-01-01 09:59:10
问题 I just tried a Python shelve module as the persistent cache for data fetched from the external service. The complete example is here. I was wondering what would the best approach if I want to make this multiprocess safe? I am aware of redis, memcached and such "real solutions", but I'd like to use only the parts of Python standard library or very minimal dependencies to keep my code compact and not introduce unnecessary complexity when running the code in single process - single thread model.

Memcached Performance

有些话、适合烂在心里 提交于 2020-01-01 05:48:12
问题 I feel the speed of Memcached in my website is slower than Mysql queries. Please see the screenshot of performance of my website I got from New Relic. I don't know how to optimize memcached in my CentOS server. Please see the configuration and performance screenshots of Memcached. I feel the number of Total Connections is high. Please see Live Stats below The following is how I use Memcached in my website <?php class dataCache { function setMemData($key, $var, $flag = false, $expire = 36000)