gpt4 book ai didi

elasticsearch - 测试 Elastic Search 时如何关闭缓存

转载 作者:行者123 更新时间:2023-11-29 02:44:40 24 4
gpt4 key购买 nike

我正在通过发送查询来对 Elastic Search 进行压力测试,但担心响应会被缓存。测试 Elastic Search 时如何关闭缓存?

最佳答案

在我回答之前,我同意对问题的评论的免责声明,禁用缓存并不是对 Elasticsearch 进行压力测试的最佳方式。同时使用代表您的生产查询集的查询和事件索引来命中它,将是查看 ES 在负载下如何响应的更好方法。

但是,要回答您的问题并指出一些注意事项:

  1. 您可以在两次运行之间清除缓存:

    The clear cache API allows to clear either all caches or specific cached associated with one ore more indices.

    https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html

  2. 您可以通过设置关闭过滤器缓存index.cache.filter.type 为 none - 这将阻止过滤结果从被缓存:

    http://elasticsearch-users.115913.n3.nabble.com/Disable-cache-td3825105.html

    http://elasticsearch-users.115913.n3.nabble.com/Disabling-cache-td3201850.html

  3. 您可以更改字段数据缓存的设置 - 但是我不知道如果将其设置为零会发生什么:

    https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-fielddata.html

  4. 不过,总的来说,请记住 Elasticsearch 非常重要使用 native 操作系统文件系统缓存,所以很多“缓存”是发生在 ES 的控制之外:

    https://blog.codecentric.de/en/2014/05/elasticsearch-indexing-performance-cheatsheet/

关于elasticsearch - 测试 Elastic Search 时如何关闭缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25212911/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com