forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
58 lines
5.0 KiB
HTML
58 lines
5.0 KiB
HTML
<a name="EN-US_TOPIC_0000001965496997"></a><a name="EN-US_TOPIC_0000001965496997"></a>
|
|
|
|
<h1 class="topictitle1">Managing the Vector Index Cache</h1>
|
|
<div id="body0000001200234616"><p id="EN-US_TOPIC_0000001965496997__p14462243103113">The CSS vector search engine is built on C++. It uses off-heap memory to enhance performance and efficiency. To better manage and optimize the vector index cache, the CSS vector database provides a number of dedicated APIs that can be used to flexibly monitor and tune cache usage to ensure stable query performance.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496997__section422063015333"><h4 class="sectiontitle">Checking Cache Statistics</h4><p id="EN-US_TOPIC_0000001965496997__p631441113345">Use the following API to check the off-heap memory usage and return key metrics such as the current off-heap memory usage, cache hits, and data loading times. These metrics help you understand the cache status, so you can adjust the cache based on its usage. In the implementation of the vector search plug-in, each segment constructs and stores an index file. During query, all these files are loaded to the off-heap memory, and the plug-in uses a cache mechanism to manage the off-heap memory.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen18789407362">GET /_vector/stats</pre>
|
|
<p id="EN-US_TOPIC_0000001965496997__p1434594010313">Example response:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen6635173115211">{
|
|
"_nodes" : { # Node information
|
|
"total" : 1, # Total number of nodes
|
|
"successful" : 1, # Number of successful nodes
|
|
"failed" : 0 # Number of failed nodes
|
|
},
|
|
"cluster_name" : "css-d3a7", # Cluster name
|
|
"cpu_circuit_breaker_triggered" : false, # Whether circuit breaking is triggered
|
|
"nodes" : {
|
|
"cAHmVUZTR9ON7t6jxcDCkg" : { # Node UUID
|
|
"cpu_cache_capacity_reached" : false, # Whether the off-heap memory usage of the current node reaches the upper limit
|
|
"cpu_eviction_count" : 0, # Number of segment-level cache swap-outs on the current node
|
|
"cpu_hit_count" : 0, # Number of segment-level cache hits on the current node
|
|
"cpu_load_exception_count" : 0, # Number of segment-level index loading failures on the current node
|
|
"cpu_load_success_count" : 0, # Number of segment-level index loading successes on the current node
|
|
"cpu_miss_count" : 0, # Number of segment-level cache misses on the current node
|
|
"cpu_query_memory_usage" : 0, # Off-heap memory usage on the current node, in KB
|
|
"cpu_total_load_time" : 0 # Total segment-level index loading time on the current node, in ms
|
|
}
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496997__section13256733153711"><h4 class="sectiontitle">Preloading Vector Indexes</h4><p id="EN-US_TOPIC_0000001965496997__p143066160384">Use the following API to preload specified vector indexes to the off-heap memory. This ensures that these indexes can be quickly accessed in subsequent queries, with high query efficiency and low latency.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen31465293916">PUT /_vector/warmup/<i><span class="varname" id="EN-US_TOPIC_0000001965496997__varname14403131184010">{index_name}</span></i></pre>
|
|
<p id="EN-US_TOPIC_0000001965496997__p03559543913">where, {index_name} specifies an index.</p>
|
|
<p id="EN-US_TOPIC_0000001965496997__p1671437174017">Example response:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen96711037104016">{
|
|
"_shards" : {
|
|
"total" : 1,
|
|
"successful" : 1,
|
|
"failed" : 0
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496997__section1717231913384"><h4 class="sectiontitle">Clearing the Cache</h4><p id="EN-US_TOPIC_0000001965496997__p133712610419">When the cache is full, the system automatically swaps its data. However, frequent cache swapping may affect query performance. You can use the following API to manually clear the vector index cache. This way, you can reclaim off-heap memory resources and ensure hot data query performance.</p>
|
|
<ul id="EN-US_TOPIC_0000001965496997__ul136221317124715"><li id="EN-US_TOPIC_0000001965496997__li5623181718472">Clear the full cache:<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen16187193114414">PUT /_vector/clear/cache </pre>
|
|
</li><li id="EN-US_TOPIC_0000001965496997__li32931824114718">Clear specified indexes from the cache:<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen218743118412">PUT /_vector/clear/cache/<i><span class="varname" id="EN-US_TOPIC_0000001965496997__varname4616134204719">{index_name}</span></i></pre>
|
|
</li></ul>
|
|
<p id="EN-US_TOPIC_0000001965496997__p1326215017473">Example response:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496997__screen526310509477">{
|
|
"acknowledged" : "true"
|
|
}</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0117.html">Configuring Vector Search for Elasticsearch Clusters</a></div>
|
|
</div>
|
|
</div>
|
|
|