memcached

store single big object in memcached vs multiple keys

孤者浪人 提交于 2019-12-11 05:37:52
问题 I have following large object (20KB) cached in memcache - Product : { BasicInfo, //~5KB SellerId, //int CityId, //int AdditionalInfo //~15KB } This is being accessed at multiple places- At some place, only sellerId or cityId is required. At some places, only basicInfo is required. At some places, whole object is required. So we are fetching whole object unnecessarily in 1st and 2nd cases while we only require some bytes. Should I store these separately in memcache (only problem is I need to

Symfony - MemcachedAdapter::__construct() must be an instance of Memcached, string given

本小妞迷上赌 提交于 2019-12-11 04:43:05
问题 This is rather bizarre. I have set up caching with Memcached as follows: framework.yaml framework: cache: app: app.memcached_adapter services.yaml app.memcached_client: class: Memcached factory: 'Symfony\Component\Cache\Adapter\MemcachedAdapter::createConnection' arguments: [['%app.memcached.dsn.1%', '%app.memcached.dsn.2%']] public: true app.memcached_adapter: class: Symfony\Component\Cache\Adapter\MemcachedAdapter arguments: - '@app.memcached_client' public: true I am able to clear cache in

Cached fragment does not stay in (Memcachier) cache

半城伤御伤魂 提交于 2019-12-11 04:43:00
问题 Using Rails 3.1.1 on Heroku, Dalli & Memcachier. Production.rb config.cache_store = :dalli_store config.action_controller.perform_caching = true Gemfile gem 'memcachier' gem 'dalli' Controller#Show unless fragment_exist?("gift-show--" + @gift.slug) # Perform complicated database query at 4-5 sec end View <% cache('gift-show--' + @gift.slug, :expires_in => 3456000) do # 40 days %> # Create an HTML <% end %> Log output when a cached page is loaded 2012-10-17T03:15:43+00:00 app[web.2]: Started

Fragment_exist for Memcache does not find cached info

狂风中的少年 提交于 2019-12-11 04:33:20
问题 I am using Rails, Dalli gem, friendly_id and Memcachier on Heroku. My problem is similar to an issue I have had previously but that stopped working after I started using Memcache instead of the default Rails cache. It should be noted that I am not very familiar with Rails caching and it is quite likely that I do many things wrong (or fail to consider simple things). production.rb config.action_controller.perform_caching = true config.cache_store = :dalli_store, 'mc2.ec2.memcachier.com:11211',

rails memcached dalli Marshalling error for key

心不动则不痛 提交于 2019-12-11 04:31:45
问题 I have such action in my controller: def my @user = Ads::User.find current_user.id @postings = Rails.cache.fetch("@user.postings.includes(:category)") do @postings = @user.postings.includes(:category) end end I'm trying to cache @postings and get such error: Marshalling error for key '@user.postings.includes(:category)': can't dump anonymous class #<Module:0x000000048f9040> You are trying to cache a Ruby object which cannot be serialized to memcached. If I try to cache @postings without

NHibernate MemCached w/ Protobuf-net.Enyim — does it actually work?

谁说我不能喝 提交于 2019-12-11 04:09:11
问题 I've used the following assemblies to hook up NHibernate 2nd-level caching with Enyim Memcached using Protobuf-net binary serializer: NHibernate NHibernate.Caches.EnyimMemcached Enyim.Caching protobuf-net protobuf-net.Enyim It's recently come to my attention that despite hooking up protobuf-net with EnyimMemcached, I'm likely not actually using that serializer as all my entities were marked with just [Serializable] and neither [DataContract] or [ProtoContract] with corresponding ordered Data

App Engine Python: AttributeError: 'module' object has no attribute 'Stock'

守給你的承諾、 提交于 2019-12-11 04:06:43
问题 I am getting this error just in production. On localhost it works well. Traceback (most recent call last): File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__ handler.get(*groups) File "/base/data/home/apps/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 74, in get 'stocks': goodStocks(), File "/base/data/home/apps/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 108, in goodStocks goodStocks = memcache

AppEngine Memcache atomic get-and-delete

自古美人都是妖i 提交于 2019-12-11 03:45:58
问题 I would like to store authentication challenges in Google AppEngine's Memcache that I index by a random integer. So, for example I have entries like: 5932 -> IUH#(*HKJSBOHFBAHV&EG*Y$#)*HF739r7fGA$74gflUSAB 11234 -> (*&YGy3g87gfGYJKY#GRO&Fta9p8yfdlhuH$UT#K&GAk&#G -3944 -> 8yU#*&GfgKGF&Y@dy;0aU#(Y9fyhgyL$BVGAZD(O$fg($&G . : If a client then tries to authenticate a request, it will send me the challenge ID (e.g. -3944) and the corresponding calculated response. Now, my server needs to grab

PHP session locking and using Memcache to store sessions

烈酒焚心 提交于 2019-12-11 02:46:35
问题 I have a standard html page that has a few img tags, each of these are pointing to a php file on our server. When the php file is loaded, it saves some data to the session before then generating an image. This data in the session from each of the scripts is then used in other script further in our application. The php file to generate the image starts with session_start and when using the native PHP session handler all seems to work great. Each execution is done correctly and the full session

Persistent memcached in PHP - server pool growing until curr_connections 10

馋奶兔 提交于 2019-12-11 02:28:56
问题 I have a problem with Memcached persistence in PHP. Memcached lib returns empty getServerList() until there are 10 concurrent connections. Couldn't find sensible explanation of that, but found people with the same problem (without solution). My example: class Cache { protected $memcached; public function __construct($cache_name) { $instance_name = 'persistent-' . $cache_name; $this->memcached = new Memcached($instance_name); $server_count = count($this->memcached->getServerList()); echo '[MC]