BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
EyalGonen
Barite | Level 11

Hi experts,

 

I am looking for an example on how to set the cpu/memory resources requests and limits for SAS internal OpenSearch.

I found example files in sas-bases/examples/configure-elasticsearch/internal/topology but none seem to provide an example.

I also wonder what are the default values as I could not find them too.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
I changed my heapsize in the sas-opendistro custom resource to 3G and the memory requests and limits were changed to 6G, so this calculation appears to be heapsize x role count, as mine is a single-node topology so the node has both master and data roles.

$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"6","memory":"2G"},"requests":{"cpu":"500m","memory":"2G"}}

$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/nodes/0/heapsize","value":"3G"}]'

For CPU, I patched the custom resource path /spec/template/spec/containers/0/resources, and the values I set were what the stateful set had applied.

$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources","value":{"requests":{"cpu":"300m"},"limits":{"cpu":"4"}}}]'

$ k delete sts sas-opendistro-default-0

$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"4","memory":"6G"},"requests":{"cpu":"300m","memory":"6G"}}
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

3 REPLIES 3
gwootton
SAS Super FREQ
In my environment my sas-opendistro-default-0 pod has requests of 500m CPU/2G Memory and limits of 6 CPU/2G Memory.

The opendistro operator uses the heapsize settings from those topology examples to set the memory requests/limits.

You're correct there is no example available for modifying the CPU setting.
--
Greg Wootton | Principal Systems Technical Support Engineer
EyalGonen
Barite | Level 11

Hi @gwootton 

 

Thanks. 

 

Do you know how the operator calculates the memory request/limit based on the defined heapsize in the topology YAMLs? 

Do you know how the operator calculates the cpu request/limit? Is there a way to control this? I want to place OpenSearch on a big machine and I want to set the cpu limit to a larger number. 

 

 

gwootton
SAS Super FREQ
I changed my heapsize in the sas-opendistro custom resource to 3G and the memory requests and limits were changed to 6G, so this calculation appears to be heapsize x role count, as mine is a single-node topology so the node has both master and data roles.

$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"6","memory":"2G"},"requests":{"cpu":"500m","memory":"2G"}}

$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/nodes/0/heapsize","value":"3G"}]'

For CPU, I patched the custom resource path /spec/template/spec/containers/0/resources, and the values I set were what the stateful set had applied.

$ k patch opendistrocluster sas-opendistro --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources","value":{"requests":{"cpu":"300m"},"limits":{"cpu":"4"}}}]'

$ k delete sts sas-opendistro-default-0

$ k get po sas-opendistro-default-0 -o jsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"4","memory":"6G"},"requests":{"cpu":"300m","memory":"6G"}}
--
Greg Wootton | Principal Systems Technical Support Engineer

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 374 views
  • 0 likes
  • 2 in conversation