// Module included in the following assemblies:
//
// *scalability_and_performance/cnf-numa-aware-scheduling.adoc

:_mod-docs-content-type: CONCEPT
[id="cnf-optimizing-topology-aware-scheduler-large-clusters_{context}"]
= Optimization strategies for large-cluster NUMA-aware scheduling

[role="_abstract"]
You can optimize the NUMA-aware secondary scheduler for clusters with 200 or more nodes by tuning cache resync intervals, polling configurations, and the scheduler QoS profile.
These optimization points help you balance scheduling accuracy, API server load, and control plane resource consumption for your specific cluster size and workload profile.

To get the best performance, coordinate the `NUMAResourcesOperator` and `NUMAResourcesScheduler` settings. The operator controls how frequently topology data is exported, and the scheduler controls how frequently it consumes that data. Aligning these intervals ensures accurate scheduling decisions while minimizing API server traffic.

== NUMAResourcesOperator settings

In the `NUMAResourcesOperator` CR, configure the following parameters to optimize for large clusters:

* For NUMA-sensitive workloads with minimal overhead, set `podsFingerprinting` to `EnabledExclusiveResources`, which is the default.
* For higher accuracy, set `podsFingerprinting` to `Enabled`. This increases the API load.
* Set `infoRefreshMode` to `Periodic` for large clusters. `PeriodicAndEvents` provides the highest accuracy but increases API load.
* Set `infoRefreshPeriod` to control how often the exporter updates topology data. This value must be shorter than the scheduler `cacheResyncPeriod` so that the cache always pulls fresh data. For example, set `infoRefreshPeriod` to 5 seconds.

== NUMAResourcesScheduler settings

In the `NUMAResourcesScheduler` CR, configure the following parameters:

* Set `cacheResyncPeriod` to control how often the scheduler refreshes its cache from the exported topology data. This value must be longer than `infoRefreshPeriod`. For example, set `cacheResyncPeriod` to 10 seconds.

* Choose a QoS profile that matches your operational requirements:
+
* `Burstable` QoS (default): The recommended setting from {product-title} 4.22. Minimizes baseline resource usage while allowing the scheduler to scale up during peak loads.
+
* `Guaranteed` QoS (opt-in): Ensures the scheduler pod is protected from eviction. Use this profile for clusters where control plane memory is frequently overcommitted or under pressure.
+
Apply the Guaranteed QoS profile by annotating the `NUMAResourcesScheduler` custom resource with the following command:
+
[source,terminal]
----
$ oc patch numaresourcesscheduler numaresourcesscheduler --type='merge'
-p '{"metadata":{"annotations":{"config.numa-operator.openshift.io/scheduler-qos-request":"guaranteed"}}}'
----
+
[NOTE]
====
This option is expected to be removed in a later {product-title} release.
====

== Best practices for large clusters

When you deploy the NUMA-aware scheduler in clusters with 200 or more nodes:

* Enable HA mode to distribute replicas across control plane nodes.
* Use `oc adm top pod` in the `openshift-numaresources` namespace to monitor actual resource consumption.
* Align your refresh intervals so the exporter provides updates faster than the scheduler cache consumes them.
