当前位置: 首页 > news >正文

常州做网站麦策互联网网站建设计划书

常州做网站麦策,互联网网站建设计划书,手机网站免费做app,可信网站认证不做对于查询操作#xff0c;Elasticsearch提供了缓存特性来暂存结果。 对于相同条件的查询请求#xff0c;在缓存中的数据失效前#xff0c;响应后续的查询操作时可以直接从缓存中提取结果#xff0c;有效降低检索操作的时延#xff0c;提升检索数据时的体验。 提到缓存相关的…对于查询操作Elasticsearch提供了缓存特性来暂存结果。 对于相同条件的查询请求在缓存中的数据失效前响应后续的查询操作时可以直接从缓存中提取结果有效降低检索操作的时延提升检索数据时的体验。 提到缓存相关的特性即要关注如下几点 缓存的开关缓存中的数据哪里来缓存占用的空间缓存中数据的老化机制缓存中的数据规模 缓存的开关 创建索引时默认启用缓存但可以在创建参数中将参数index.requests.cache.enable指定为false从而关闭缓存。 命令样例如下 curl -X PUT https://localhost:9200/testindex_003?pretty -H Content-Type: application/json -d {settings: {index.requests.cache.enable: false} }--cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {acknowledged : true,shards_acknowledged : true,index : testindex_003 }检查索引testindex_003的参数命令样例如下 curl -X GET https://localhost:9200/testindex_003/_settings?pretty --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {testindex_003 : {settings : {index : {routing : {allocation : {include : {_tier_preference : data_content}}},number_of_shards : 1,provided_name : testindex_003,creation_date : 1702050678193,requests : {cache : {enable : false}},number_of_replicas : 1,uuid : 9r8VrKdURhqr1XJM8Z9egQ,version : {created : 8500003}}}} }在索引创建完毕之后可以通过Update index settings API修改开关的状态。 例如刚才在创建索引testindex_003时关闭了缓存可以通过执行命令手工开启缓存。 命令样例如下 curl -X PUT https://localhost:9200/testindex_003/_settings?pretty -H Content-Type: application/json -d {index.requests.cache.enable: true }--cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {acknowledged : true }检查索引testindex_003的参数命令样例如下 curl -X GET https://localhost:9200/testindex_003/_settings?pretty --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {testindex_003 : {settings : {index : {routing : {allocation : {include : {_tier_preference : data_content}}},number_of_shards : 1,provided_name : testindex_003,creation_date : 1702050678193,requests : {cache : {enable : true}},number_of_replicas : 1,uuid : 9r8VrKdURhqr1XJM8Z9egQ,version : {created : 8500003}}}} }执行检索操作时依据业务要求指定缓存的开关比如禁止从缓存中提取数据命令样例如下 curl -X GET https://localhost:9200/testindex_003/_search?request_cachetruepretty -H Content-Type: application/json -d {size: 0,aggs: {popular_colors: {terms: {field: colors}}} }--cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9缓存中的数据 假定启用了缓存特性Elasticsearch节点处理检索请求时执行如下操作 处理查询请求时则使用查询条件作为关键字从缓存中提取数据。假如可以从缓存中提取到相关记录则返回这部分记录本次处理完毕。假如没有从缓存中提取到相关记录则执行检索操作。检索操作完毕使用查询条件作为关键字将处理结果缓存至缓存中。假如缓存空间不足则使用LRU算法清理缓存中的记录直至可用空间足够保存刚才的检索结果。返回检索结果。 上述为检索操作的一般流程实际的执行流程以Elasticsearch的实现为准。 缓存占用的空间 缓存可占用的空间默认值为Elasticsearch进程Java堆空间的%1。 在节点的配置文件$ES_HOME/config/elasticsearch.yml中指定配置样例如下 indices.requests.cache.size: 2%配置项indices.requests.cache.expire用于指定缓存中数据的生命周期。 考虑到Elasticsearch后台定期执行的Refresh操作会自动清理缓存中的过期数据因此一般不需要配置indices.requests.cache.expire。 清理缓存 手工清理缓存命令样例如下 curl -X POST https://localhost:9200/testindex_001/_cache/clear?requesttruepretty --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {_shards : {total : 2,successful : 1,failed : 0} }缓存的使用情况 可以使用如下API来获取使用情况。 Index stats APINodes stats API Index stats API 基于索引的粒度统计缓存的使用情况。 命令样例如下 curl -X GET https://localhost:9200/_stats/request_cache?humanpretty --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {_shards : {total : 13,successful : 5,failed : 0},_all : {primaries : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}},total : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}}},indices : {cloned-testindex_002 : {uuid : Lrz1DOsWRY6OTt0Veawo-w,health : yellow,status : open,primaries : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}},total : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}}},testindex_002 : {uuid : k6twq9y9Qtmcs2AHK-USEQ,health : yellow,status : open,primaries : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}},total : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}}},testindex_001 : {uuid : 7iGJRFfxRd2jD3qP-KDRmQ,health : yellow,status : open,primaries : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}},total : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}}}} }Nodes stats API 基于集群中节点的粒度统计缓存的使用情况。 命令样例如下 curl -X GET https://localhost:9200/_nodes/stats/indices/request_cache?humanpretty --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:ohCxPHQBEs5*lo7F9执行结果的样例如下 {_nodes : {total : 1,successful : 1,failed : 0},cluster_name : elasticsearch,nodes : {aKgBu7LgS9a6iPYH8n2JPw : {timestamp : 1702049373653,name : jackie-ubuntu,transport_address : 127.0.0.1:9300,host : 127.0.0.1,ip : 127.0.0.1:9300,roles : [data,data_cold,data_content,data_frozen,data_hot,data_warm,ingest,master,ml,remote_cluster_client,transform],attributes : {transform.config_version : 10.0.0,ml.machine_memory : 4040318976,ml.allocated_processors : 4,ml.allocated_processors_double : 4.0,ml.max_jvm_size : 2021654528,ml.config_version : 11.0.0,xpack.installed : true},indices : {request_cache : {memory_size : 0b,memory_size_in_bytes : 0,evictions : 0,hit_count : 0,miss_count : 0}}}} }相关资料 Shard request cache settingsClear cache APIUpdate index settings APIIndex stats APINodes stats APIAggregationsSuggesters
http://www.hn-smt.com/news/40050/

相关文章:

  • 2025 Autel IM608 PRO II Full Kit – Advanced Diagnostics with Free G-Box3
  • 小红书-强共鸣、高热度的话题----每一个都精准命中测试员的日常,非常适合在小红书打造“测试职场达人”人设。
  • 软件工程学习日志2025.11.14
  • MC 红石电路
  • 轨迹方程1
  • Linux增加root权限用户
  • 2025年11月宁夏GEO/人工智能搜索优化服务商/厂商/企业最新top5专业推荐:GEO引领智能营销新范式
  • 《Java工程师必看:JVM性能调优的7个核心参数》‌
  • 探索“AI元人文”构想:致学者、技术专家与爱好者的一篇导言
  • 《团队协作:如何高效进行代码审查》
  • Spring AI Alibaba 项目源码学习(六)-Agent Framework 工作原理与使用
  • 重组融合蛋白技术概述
  • 【AI智能体】Coze 提取对标账号短视频生成视频文案实战详解 - 指南
  • 完整教程:PDFBox - PDDocument 与 byte 数组、PDF 加密
  • 图片合集
  • 升幂引理(LTE)
  • 20251114——读后感5
  • Http基础协议和解析 - 指南
  • 备份一点有趣的东西(期刊资源)
  • 2025年11月徐州网站建设服务商综合评测与选择指南
  • Number Theory
  • linux 安装telnet 服务
  • 应用程序建立的数据库连接,也就是非交互式连接 是什么时候开始的?什么时候结束?连接结束后 会影响应用程序操作db失败吗? 还有就是如果连接关闭了 会立马重新建立新的连接吗?
  • 2025智能科技/医疗设备/信息科技/新中式茶饮/科创/平面/东方美学/品牌设计/品牌logo设计/品牌VI设计领域优质公司排行榜:聚焦全案创意与视觉赋能,3 家机构助力品牌高效破圈
  • 2025广东洗头机厂家推荐榜:盛泰科技领衔,三大品牌解锁高效洗护新体验
  • 2025年第43周数字取证与事件响应技术动态
  • 长连接和短连接
  • 2025 年微矩形 /圆形/矩形电连接器厂家最新推荐排行榜,涵盖 MDC/ZMDM/Y50X 等系列优质品牌精选
  • 2025 年 11 月毛刷辊厂家推荐排行榜,工业毛刷辊,定做毛刷辊,清洁毛刷辊,纺织毛刷辊,钢制毛刷辊公司精选
  • 消息队列原理和对比