Elasticsearch - limit to half of available cpu cores

Hi. Is there an option to limit Elasticsearch to run, for example, on only half of available cpu cores on the machine? I'm running some heavy queries on my ELK instance which sometimes loads all cores at 100%. Since there are also other services running on this machine, the situation is not perfect.

Thanks for any suggestions!

Running ES in Docker and leveraging cgroups would go into that direction, I'd say.

That's definetely a way to have it done, but currently I'm using regular Debian packages for ELK and would like to keep it that way.

The other ways I know of are:

  • using nice to manually lower the process priority or
  • using cpulimit to repeatedly pause the process and keep it within a certain limit
  • plus of course cgroups again

Outside of a container, I don't think this is good practice, though. cpulimit will send SIGSTOP/SIGCONT signals to the elasticsearch process and I'm not sure about the effects this can have . nice is too "soft" for what you want to achieve.

My advice if you don't want to leverage Docker for now, install ES on a dedicated host.

My advice if you don't want to leverage Docker for now, install ES on a dedicated host.

Right. Thank you for your help!

Does anyone know an approach that would fit my current environment?

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