[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] libnbd flamegraph Odd benchmark results




The question (for you!) is how we can choose better settings, and
whether we should choose
 
 In my opinion configuration resolution will be best if resolved in the following order of increasing priority/weightage.
1. Auto-detect depending on the system parameters.
Auto-detection of best params is a must IMO as there's
enough diversity in server hardware that one size won't fit
all can be implemented without much effort(excluding benchmarking).

2. Configuration file: A yaml, toml, or any other simple format
- Load a different config file with *nbdcopy --file=custom-config.yaml*
- Maybe generate the default config file having values from the auto-detect phase.
nbdcopy --generate-config

~/.config/nbdcopy/config.yaml (used to get values)
~/.config/nbdcopy/example.yaml (generated for reference from auto)

3. CLI params
A quick way to override configuration file params
ex: functionally same
`nbdcopy --requests=4 --config=custom-config.yaml`
`nbdcopy --config=custom-config.yaml --requests=4`

The flow of initialization:
Read config file ----override ---> CLI params --- missing params --> auto-detect fill
or
easier implementation:
auto-detect fill --- override ---> config file --- override ---> CLI params


The rationale for choosing configuration file method:
- Easier to use avoiding long commands (less typing, scripts easier to read)
- Easy switch between multiple configurations and override them.
- Documentation and configuration in the same place
So easier for someone else to understand why certain parameters were chosen.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]