# Does the choice of k have a significant effect on memory/cpu?

**URL:** <https://forum.opensearch.org/t/does-the-choice-of-k-have-a-significant-effect-on-memory-cpu/18318>\
**Category:** k-NN\
**Created:** [March 9, 2024, 4:22pm UTC](https://forum.opensearch.org/t/does-the-choice-of-k-have-a-significant-effect-on-memory-cpu/18318 "2024-03-09T16:22:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asfoorial](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Post date:** [March 9, 2024, 4:22pm UTC](https://forum.opensearch.org/t/does-the-choice-of-k-have-a-significant-effect-on-memory-cpu/18318/1 "2024-03-09T16:22:14Z")

</div>

Hi all,

How does the choice of k affect memory and cpu in the kNN plugin?

I am currently studying the trade-off between large/small/super-small dimensional index. I am thinking of going super-small to save on storage and indexing speed. That would, however, require me to always set k to be high (\>=100), and leave the rest to the cross-encoder (a fast/efficient one). My only concern is with memory and cpu when I have heavy search load.

I highly appreciate your thoughts on the matter.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [May 8, 2024, 4:22pm UTC](https://forum.opensearch.org/t/does-the-choice-of-k-have-a-significant-effect-on-memory-cpu/18318/2 "2024-05-08T16:22:39Z")

</div>

Closed on May 8, 2024, 4:22pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
