-
Notifications
You must be signed in to change notification settings - Fork 794
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
hidden_items_v2 performance optimization #766
Comments
如果删除的ID数量比较多,导致在Redis中存储的Sorted Set中存在大key,你可以考虑以下优化方法:
需要根据你的具体业务需求和系统环境来选择合适的优化方法。优化方案的选择应该综合考虑数据规模、性能需求、实施复杂度以及可行性等因素。 If the number of deleted post IDs is relatively large, leading to a large key in the Sorted Set stored in Redis, you can consider the following optimization methods: Sharding: Split the large Sorted Set into multiple smaller ones. Distribute the post IDs to different Sorted Sets based on a certain rule, such as the hash value or range of the post ID. This way, the data will be scattered across multiple smaller Sorted Sets, avoiding the issue of a single Sorted Set becoming too large. Regular archiving: Move expired post IDs from the current Sorted Set to an archived Sorted Set. This can be done through a scheduled task or a background process. The archived Sorted Set can be stored elsewhere (such as another cache storage, a database, etc.), or you can archive older post IDs into different Sorted Sets based on your needs. Use alternative data structures: If the large number of elements in the Sorted Set causes performance degradation, you can consider using other more suitable data structures to store the deleted post IDs. For example, you can use Redis’ HyperLogLog data structure to estimate the cardinality of the post IDs and perform deletions based on certain rules. Distributed caching: If you need to handle a very large-scale post ID data and Redis cannot meet the performance requirements, you may consider using a distributed caching system like Memcached or Redis Cluster. These systems can scale horizontally and provide higher capacity and throughput. The choice of optimization methods should be based on your specific business requirements and system environment. The selection should consider factors such as data scale, performance needs, implementation complexity, and feasibility. |
0.5将优化推荐缓存的存储,代价是Redis不再被支持,需要使用RediSearch |
0.5 will optimize the storage of recommended caches at the cost of Redis no longer being supported and RediSearch required. |
Is your feature request related to a problem? Please describe.
all hidden item store in one zset, will cause the zset too large and redis will timeout
Describe the solution you'd like
maybe can use boolm filter , but Collect garbage in cache is an unavoidable problem
The text was updated successfully, but these errors were encountered: