awslabs / damo

DAMON user-space tool
https://damonitor.github.io/
GNU General Public License v2.0
148 stars 28 forks source link

[RFC] support damo update command #72

Open honggyukim opened 11 months ago

honggyukim commented 11 months ago

Hi SeongJae,

I've been testing using damo schemes, but I often need to change the configuration such as -s, -a, -u, --monitoring_nr_regions_range and -c option as well.

I normally stop damo schemes execution then relaunch the scheme after modifying a few fields. But I feel this can be simplified if there is a new command damo update, then use the same options, but only provide a few options that I want to change.

Example usage is that the damo schemes begins with a simple config.json file as follows.

$ sudo ./damo schemes -c config.json
Press Ctrl+C to stop

While running this command, I want to rerun the schemes with --monitoring_nr_regions_range 100 10000. The current usage is as follows.

^C        # Stop the previous damo schems execution

# Re-run the `damo schemes with an additional option`, but previous same options have to be provided again.
$ sudo ./damo schemes --monitoring_nr_regions_range 100 10000 -c config.json
Press Ctrl+C to stop

I think it'd be useful if the following imaginary use case is supported.

# Run the initial damo schemes
$ sudo ./damo schemes -c config.json
Press Ctrl+C to stop

# Change the number of monitoring regions only, but keep the other configuration same.
$ sudo ./damo update --monitoring_nr_regions_range 100 10000

The above damo update command only applies the given change, then write commit to kdamonds/0/status. The points are as follows.

This might be useful only for me but I would like to hear how you think about this.

sj-aws commented 11 months ago

Hi Honggyu, nice suggestion, thank you. Actually, we have not-yet-official feature for the purpose, namely damo tune. It receives the usual arguments like damo start and damo scheme. You can tune specific DAMON parameters using the subcommand. Note that it doesn't know if you want to change only specific parameter or not. You should put every parameter to the command unless the values are not the default ones.

And damo scheme might be not a good start command to use damo tune later. I usually simply do damo start, and then usd damo tune to test some schemes. e.g.,

damo start
damo tune --damos_action stat
damo show
damo tune --damos_action stat --damos_access_rate 5% max

Note that you should put --damos_action stat again for second tune, because that's not the default value of the parameter.

And sorry again for not making it documented and be official yet. I was unable to sure if that's stable enough to be documented, and can be maintained for long term. But now I start feeling the feature is becoming more stable and ready to be documented, mostly due to increased use of damo, especially from you. Current ETA is OSSummit Europe.

sj-aws commented 8 months ago

So, the feature exists, and the usage document has updated (https://github.com/awslabs/damo/blob/next/USAGE.md#damo-tune). Any more remaining question or thing that I could help?

honggyukim commented 8 months ago

I haven't tested the feature yet but thanks very much. Could you just keep the issue open? I will test it when I can find some time.

sj-aws commented 8 months ago

No problem. Please take your time to test. :)