问题标签 [distributed-caching]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
caching - 更改 MemCached 最大块大小的影响
以 100MB 的最大缓存块大小运行 MemCached 的缺点是什么(如果有的话)?
它与使用 10MB 或 1MB 页面的运行有什么显着不同吗?反过来说,你为什么要运行 MemCached 并使用较小的页面(例如 100k)呢?
如果 MemCached 设置为使用 100MB 的最大大小,它是否会为每个内存单元实际分配 100MB,而不管它实际有多大?
java - 使用 Hazelcast 哪个更好,一张大地图还是多张小地图?
我想创建一个限速器系统,可以限制对多台服务器的请求。为此,我想创建计数器(每个 ip 地址 1 个计数器),这样所有服务器都可以检查和更新这些计数器。
我的问题是:最好的方法是什么,创建一个映射并使用客户端的 ip 地址作为键,该 ip 的计数器将在 java 对象中。该对象将是映射条目的值。
或者
为每个 IP 地址创建一个映射,并使用计数器名称作为键和计数器值作为条目的值 (int)
我的首要任务是速度。检索计数器对象并增加它必须非常快。
那么什么是最好的呢?许多小地图还是一张大地图?
我希望有人可以帮助我。
问候,
马丁
hibernate - 使用休眠进行缓存
我有 2 个应用程序。第一个是 Web 应用程序,我们通过它提供参考数据。第二个是基于 ESB 的应用程序,其中使用了参考数据。参考数据更改但不是很频繁。我们需要缓存参考数据。 Web 应用程序(我不是所有者)使用休眠。但是我的基于 ESB 的应用程序没有。我们只使用了 EHCache。当需要反映在 ESB 应用程序中的独立 Web 应用程序更改参考数据时。我们使用消息队列实现 - 即当参考数据更改时,Web 应用程序向消息队列发送消息。我们的 ESB 应用程序侦听该消息并清除缓存并再次缓存数据。这很有效。但它很耗时。如何使用 Hibernate 来改善这种情况?
问候, Subhendu
java - EhCache,JPA 2.0 L2 缓存,缓存策略
大家好,
我是 L2 缓存世界的新手,所以请放轻松:)。我有几个问题:
1) EhCache 与 JPA 2.0 L2 缓存有什么区别?
据我了解,EhCache 是分布式的(也可以是独立的),而 JPA 2.0 L2 缓存不是(每个 JVM)。
2) 缓存策略
请分享您的缓存 101 策略。如何缓存收藏(问题和提示)?如何在缓存池中搜索对象(如果您知道正在缓存它)。
3)缓存和存储过程
假设数据库在其之上支持 2 个不同的应用程序。当一个应用程序通过存储过程更新数据而另一个(缓存)读取它时,如何解决更新问题?对读者来说,就好像没有更新一样。
我听说某些大型网站会缓存所有内容。这是否意味着他们在缓存库和 JPA / ORM 之上编写了自己的数据访问层?
PS:我知道黄金法则是尽早避免缓存,或者更好地增加硬件能力。我问这个问题是为了学习。我也不是要求一个特定的场景,而是更多的一般规则,一般场景,最小公分母,它不必解决每个人的问题。
谢谢!
caching - 是否可以在 Varnish 中进行甜甜圈缓存?
我是一名 ASP.NET 开发人员,试图了解更多关于如何在开源堆栈上完成缓存的知识。我想知道是否可以像使用 ASP.NET MVC一样在 Varnish 上进行甜甜圈缓存。
我意识到 Varnish 是一个分布式缓存系统,而 ASP.NET MVC 示例是本地缓存,但是是否可以在 Varnish 中实现这种行为?
performance - 推荐缓存更新策略
我们的站点最近被分成了几个较小的站点,然后分布在不同的IDC中。
其中一个站点提供用户身份验证和其他与用户相关的服务,其他站点通过 Web 服务访问它。
在每个远程获取数据的站点上,我们都会创建一个本地缓存,这样我们就不必在每次需要用户信息时都去远程。
您会推荐什么缓存更新策略来确保数据完整性?
caching - Paging, listing and grouping queries with AppFabric Cache
I read a lot of documents about AppFabric caching but most of them cover simple scenarios. For example adding city list data or shopping card data to the cache. But I need adding product catalog data to the cache.
I have 4 tables:
Product (1 million rows), ProductProperty (25 million rows), Property (100 rows), PropertyOption (300 rows)
- I display paged search results querying with some filters for Product and ProductProperty tables.
- I am creating criteria set over searched result set. For example (4 Items New Product, 34 Items Phone, 26 Items Book etc.)
- I query for grouping over Product table with columns of IsNew, CategoryId, PriceType etc.
and also another query for grouping over ProductProperty table with PropertyId and PropertyOptionId columns to get which property have how many items
Therefore to display search results I make one query for search result and 2 for creating criteria list (with counts)
Search result query took 0,7 second and 2 grouping queryies took 1,5 second in total. When I run load test I reach 7 request per second and %10 dropped by IIS becasue db could not give response.
This is why I want to cache Product and property records.
If I follow items below (in AppFabric);
- Create named cache
- Create region for product catalog data (a table which have 1 million rows and property table which have 25 million rows)
- Tagging item for querying data and grouping.
Can I query with some tags and get 1st or 2nd page of results ? Can I query with some tags and get counts of some grouping results. (displaying filter options with count) And do I have to need 3 servers ? Can I provide a solution with only one appfabric server (And of course I know risk.) Do you know any article or any document explains those scenarios ?
Thanks.
Note:
Some additional test: I added about 30.000 items to the cache and its size is 900 MB. When I run getObjectsInRegion method, it tooks about 2 minutes. "IList> dataList = this.DataCache.GetObjectsInRegion(region).ToList();" The problem is converting to IList. If I use IEnumerable it works very quicly. But How can I get paging or grouping result without converting it to my type ?
Another test:
I tried getting grouping count with 30.000 product item and getting result for grouping took 4 seconds. For example GetObjectByTag("IsNew").Count() and other nearly 50 query like that.
azure - 你推荐任何关于分布式系统和云计算的好书吗?
我正在学习 Microsoft Azure,有很多概念虽然对我来说并不新鲜,但我想了解更多关于它们的信息,例如数据库分片、非规范化、nosql、内容交付网络、分布式缓存(像memcache),异步处理,拆分系统,负载平衡等......等等......
我正在寻找一本关于方法而不是技术的书。
问题是我可以阅读很多关于如何使用 Azure 存储,或者如何使用 Azure CDN 的信息,但是如果没有正确的方法,结果不会像预期的那么好。
提前致谢。
java - 当 Terracotta 服务器用作带有 Hibernate 的 EHCache 的后端时,它会做什么?
我的 DAL 是用它实现的Hibernate
,我想将EHCache
其用作具有分布式功能(用于可伸缩性和 HA)的二级缓存。
看到EHCache
只提供分布式缓存Terracotta
我的问题是Terracotta
服务器实例的作用是什么?它还保存数据吗?它是否只协调分区缓存部分之间的分布?
我的困惑主要来自关于 TSA的解释,它说服务器保存数据,但我认为在我的场景中缓存和Terracotta
服务器可能是合并的。我对么?
如果服务器确实保存了数据,那么为什么瓶颈不应该从数据库转移到Terracotta
服务器呢?
更新: Affe 的回答回答了我的问题的第二部分,这是重要的部分,但以防万一有人来寻找第一部分,我会说 TC 服务器必须保存内存中 EHCache 保存的所有数据,所以如果您想要一个分布式缓存(不复制),那么 L2(TC 服务器)也必须自己保存所有对象。
提前致谢,
Ittai
java - Ehcache - 使用 RMI 的复制缓存
我尝试使用 ehcache 并且它有效。我只是想用 ehcache RMI 实现分布式缓存。我按照网址中提供的步骤操作:http ://ehcache.org/documentation/distributed_caching_with_rmi.html?cf03800515=21D4D871!NTAxODEzNDE0OmNvcnByYWRpdXNzc286vsRypkVtSPb7t3MnL22gFQ==#
但我找不到分布式缓存工作......
我给了一些端口号,我在两台机器上都有独立的 java 代码。首先,我在朋友的机器上运行主程序,将数据放入“deviceCache1”,然后我尝试在我的主程序中访问该缓存。但我没有发现两台机器之间发生任何连接。
我可能听起来很傻,但我需要知道一些关于缓存的事情。请有人澄清我的疑问并帮助我。所以,我的问题是: 1. 需要在两台机器的 ehcache.xml 中提供哪些端口 ID?2. 我是否需要启用一些 Windows 服务才能使用 rmi 端口?3.我需要添加任何其他代码来连接两台机器吗?
请尽快帮助我。谢谢