Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a high priority to the Alloy process on Windows #2651

Open
ptodev opened this issue Feb 7, 2025 · 3 comments
Open

Set a high priority to the Alloy process on Windows #2651

ptodev opened this issue Feb 7, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@ptodev
Copy link
Collaborator

ptodev commented Feb 7, 2025

Request

It would be good if there is a way to configure Alloy to always have a high priority such as "realtime" or "high". I don't think it should be the default though. Alloy may not always be a very critical piece of software for the person who installed it.

There could be a few ways to do this:

  • Via Alloy's config file. This would have to be a top-level service block similar to remotecfg, because there cannot be more than one such block for an Alloy instance. We'd need to make sure the priority is set accordingly. E.g. if an Alloy instance is ran with a windows block that gives it a high priority, and the block is removed and the config is reloaded, Alloy should go back to using normal priority.
  • Via a new Alloy command line argument. This is simpler. The downside is that editing the command line parameters is usually more difficult than editing the config file. On Windows, the command line parameters for the Alloy service are stored in HKEY_LOCAL_MACHINE\SOFTWARE\GrafanaLabs\Alloy.

Use case

Alloy may not work properly when the machine is resource constrained. Since Alloy is used for monitoring, many users would it to work even if there is not much free memory and CPU. That way they can spot issues with the OS and with applications.

A customer recently noticed that their Alloy instance wasn't sending metrics when the CPU consumption is high. To resolve this, they:

  1. Set the priority of the Alloy process to "realtime".
  2. Disabled the service collector in prometheus.exporter.windows.
@ptodev ptodev added the enhancement New feature or request label Feb 7, 2025
@Nachtfalkeaw
Copy link

I have alloy running in an Environment with high load and alloy stops sending Windows metrics daily between 8am and 5pm.

Changing priority of the process is ok If it helps.
Except only Set it to "high" or "Realtime" please allow to Set it to lower priority as normal If possible. Sometimes Business critical appliances are more important than alloy.

Another Thing i would Like to See ist a metric or a Log Message If alloy can Not get the ressources it needs and stops collecting metrics. However i am Not Sure If this is possible.

@ptodev
Copy link
Collaborator Author

ptodev commented Feb 10, 2025

@Nachtfalkeaw do you also use loki.source.windowsevent? In Alloy v1.7 there will be a few changes (this and this) which optimise its CPU consumption. I wonder if this would make the process lightweight enough that the OS can schedule it fine even under high CPU load. Additionally, you could try using enable_v2_collector or use_api in the services metrics collector.

cc @wildum

@Nachtfalkeaw
Copy link

@ptodev I am one of the persons who is Testing this new 1.7.x Loki.source.windowsevent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants