C# Can';t将对象存储到membase中,我如何知道原因?
我正在尝试将对象存储到缓存中,如下所示:C# Can';t将对象存储到membase中,我如何知道原因?,c#,winforms,memcached,couchbase,enyim,C#,Winforms,Memcached,Couchbase,Enyim,我正在尝试将对象存储到缓存中,如下所示: Dictionary<Guid, Decimal> cacheSubscribers = client.Get<Dictionary<Guid, Decimal>>("ListAllSubscribers"); if (cacheSubscribers == null) { cacheSubscribers = db.JK_Subscribers
Dictionary<Guid, Decimal> cacheSubscribers =
client.Get<Dictionary<Guid, Decimal>>("ListAllSubscribers");
if (cacheSubscribers == null)
{
cacheSubscribers = db.JK_Subscribers
.Where(x => x.sync)
.Select(x => new { x.guid, x.subscriber_id })
.ToDictionary(x => x.guid, x => x.subscriber_id);
if (!client.Store(StoreMode.Set, "ListAllSubscribers", cacheSubscribers, ts))
MessageBox.Show("Could not store ListAllSubscribers");
}
而这个总是添加到内存中
有没有办法找到我无法存储该对象的原因
字典
大约有95000条记录,在我的配置中
<socketPool minPoolSize="10"
maxPoolSize="100"
connectionTimeout="00:01:00"
deadTimeout="00:02:00" />
另外,我在本地主机上使用的是
localhost
我不确定,因为代码不熟悉。所以我问:您是否正在尝试存储由95000条记录组成的词典?
Membase与memcached非常相似,因此我建议检查您可以存储的对象的大小是否有限制..正如我所知,memcached的大小为1mb您可以使用
[ExecuteStore][1]
方法,该方法返回IStoreOperationResult
对象,而不是bool
,在那里您可以找到消息、异常、,等等…这并不总是有帮助,但值得一试 编辑:使用Couchbase.NET客户端库1.1
<socketPool minPoolSize="10"
maxPoolSize="100"
connectionTimeout="00:01:00"
deadTimeout="00:02:00" />