-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Occasionally dropping nodes #1
Comments
Could you describe what you're experiencing a little more? When they stop do you receive any errors or is data just not being stored/retrieved from the nodes? |
I'll try and provide as much detail as I can Here are some example assets to build context: ExampleCache wrapper public class ExampleCache : IExampleCache
{
private readonly Enyim.Caching.MemcachedClient _client;
public ExampleCache()
{
_client = new Enyim.Caching.MemcachedClient(new Amazon.ElastiCacheCluster.ElastiCacheClusterConfig("clusterClient/memcachedAuth"));
}
public void StoreSomeString(string key, string someString, TimeSpan expiry)
{
_client.Store(Enyim.Caching.Memcached.StoreMode.Set, key, someString, expiry);
}
public string GetSomeString(string key)
{
_client.Get<string>(key);
}
} configuration <?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="clusterClient">
<section name="memcachedDifferentCache" type="Amazon.ElastiCacheCluster.ClusterConfigSettings, Amazon.ElastiCacheCluster"/>
<section name="memcachedExample" type="Amazon.ElastiCacheCluster.ClusterConfigSettings, Amazon.ElastiCacheCluster"/>
</sectionGroup>
</configSections>
<clusterClient>
<memcachedDifferentCache>
<!-- configuration endpoint for auto node configuration! -->
<endpoint hostname="other.xxxxxx.cfg.use1.cache.amazonaws.com" port="11211"/>
</memcachedDifferentCache>
<memcachedExample>
<!-- configuration endpoint for auto node configuration! -->
<endpoint hostname="example.xxxxxx.cfg.use1.cache.amazonaws.com" port="11211"/>
</memcachedExample>
</clusterClient>
</configuration> // Example Fake Nancy Module
public class MyModule : Module
{
private readonly IExampleCache _cache;
public MyApp(IExampleCache cache)
{
_cache = cache;
Post["/cache"] = _ =>
{
var someModel = this.Bind<SomeModel>();
_cache.StoreSomeString(someModel.Key, someModel.Value, TimeSpan.FromDays(1));
return Response.AsJson(someModel);
}
Get["/cache/{key}"] = _ =>
{
var key = _.key;
var item = _cache.GetSomeString(key);
var someModel = new SomeModel
{
Key = _.key,
Value = item
};
}
}
} The above little fake app is a pretend Nancy http app that sets and returns strings by key supported by the memcached cache. The IExampleCache constructor dependency is injected into When the app starts up, it lasts for quite some time storing and getting items. But then, at some currently undetermined timeframe, it stops storing and retrieving strings as if the cache has gone offline. I have waited for over 10 min to see if the cache comes back online, but it never does. This is only the case when I'm using the I wish I had some errors trapped for you, but I do not. I will try to see if I can trap some in the meantime. Hope this helps. |
I am facing the same probelm .I configured everything but nothing is storing in memcache. program.cs ElastiCacheClusterConfig config = new ElastiCacheClusterConfig("skillogic-cache1.lzfeej.cfg.use1.cache.amazonaws.com", 11211);
|
@kirtisanghi is your issue consistent or does it first work and then stop working? |
Hi David.. |
Am I doing anything wrong? Thanks in advance. |
@kirtisanghi sounds like you're experiencing a different issue then, perhaps. Does your example code work when you don't use the ElastiCacheClusterConfig and instead use the default memcached configuration with it pointing to one or more nodes in the cluster? When you're testing this, are you testing on a machine that has access to the Elasticache cluster via Cache Security Group? My suspicion is that if it also doesn't work using the built-in configuration for Enyim Memcached, then you probably have a security group issue. |
When I used Couchbase it was working with default memcached configuration. Thanks a lot |
Ok, so if it was working with Couchbase then perhaps there is another issue. But, I am able to successfully use Enyim's default configuration for memcached, and also use I haven't had a chance to turn on debug logs yet because Enyim's logging hooks are out of date. For you though, try confirming that it works with Enyim's default configuration as specified in that link I gave. The basic difference is that you're specifying each node individually instead of using the auto-discovery magic which this library aims to provide. In Enyim's docs, you can see that nodes can be specified either by app.config or an object implementation of |
<enyim.com>
</enyim.com> Do I need to specify other properties as well? |
Yep, as long as you specify like this: <servers>
<!-- make sure you use the same ordering of nodes in every configuration you have -->
<add address="ip address" port="port number" />
<add address="ip address" port="port number" />
</servers> inside the enyim.com/memcached block, it should be right. |
@davidsulpy I just released version 1.0.0.1 of the client which fixes an issue with the nodes being considered dead nodes and never being reattempted. Can you let me know if that fixes your problem. |
Ok I will use.Thanks |
Hi David, Is there any way to find the no of items in cache through c# code. Thanks in Advance |
@kirtisanghi https://github.com/enyim/EnyimMemcached/blob/master/MemcachedTest/MemcachedClientTest.cs#L358 If you look at that like (350) you can see how the Enyim team is testing the flush. Additionally there is an unanswered SO question here that may help you: http://stackoverflow.com/questions/18408956/enyim-memcached-client-getting-cluster-cached-item-count For your tests, I'd recommend doing something like the what the Enyim team is doing. |
Hi I am using the new released version but I am facing problem. It stored only 6 keys not its not writing to the cache. |
It stored only 6 keys now its not writing to the cache. Is there any limit? Thanks in advance. |
@normj @davidsulpy Can you please assist, did you find any solution? Thanks! |
@davidsulpy was your issue resolved? Am having the same issue. With more debugging, I was able to find out that autodiscovery does not work as expected. My key is stored in node A, but to retrieve the value for the node, it is trying to get from node B. And obviously, it returns nothing. It does not occur very frequently, but this issue needs to be resolved in my application. Anybody else facing this issue? Thanks |
I've switched from enyim memchached library over to this library to take advantage of node auto-discovery. At first pass it looks great! However, I've been noticing that occasionally, without identifiable trigger (yet) my connections to any cache node just stop. This issue does not occur when using the enyim memcached directly and specifying all the nodes in the cluster specifically in configuration which leads me to believe the issue is happening somewhere in this client.
Is this issue experienced by anyone else? What can I do to help resolve this?
Cheers,
David
The text was updated successfully, but these errors were encountered: