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

storage: support per-store IO metrics with fine granularity #119885

Merged
merged 3 commits into from Mar 18, 2024

Conversation

CheranMahalingam
Copy link
Contributor

@CheranMahalingam CheranMahalingam commented Mar 4, 2024

Currently, timeseries metrics are collected on a 10s interval which hides momentary spikes in IO. This commit introduces a central disk monitoring system that polls for disk stats at a 100ms interval. Additionally, the current system accumulates disk metrics across all block devices which includes noise from unrelated processes. This commit also adds support for exporting per-store IO metrics (i.e. IO stats for block devices that map to stores used by Cockroach).

These changes will be followed up by a PR to remove the need for customers to specify disk names when setting the provisioned bandwidth for each store as described in #109350.

Fixes: #104114, #112898.
Informs: #89786.

Epic: None.
Release note: None.

Copy link

blathers-crl bot commented Mar 4, 2024

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@CheranMahalingam CheranMahalingam self-assigned this Mar 4, 2024
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@CheranMahalingam CheranMahalingam force-pushed the granular_per_store_metrics branch 14 times, most recently from e7dd5eb to 3a0538f Compare March 11, 2024 18:29
@CheranMahalingam
Copy link
Contributor Author

CheranMahalingam commented Mar 11, 2024

These changes were verified e2e by running a 3-node cluster, each with additional ebs volumes to run 2 stores.

roachprod create $CLUSTER -n=3 --clouds=aws \
--aws-zones=us-east-1b:6 \
--aws-machine-type-ssd=i4i.8xlarge \
--aws-enable-multiple-stores=true \
--aws-ebs-volume='{"VolumeType":"gp3","VolumeSize":5000,"Iops":16000,"Throughput":1000}' \
--aws-ebs-volume='{"VolumeType":"gp3","VolumeSize":5000,"Iops":16000,"Throughput":1000}'

roachprod put $CLUSTER artifacts/cockroach
roachprod start $CLUSTER --store-count=2
Screenshot 2024-03-11 at 3 15 37 PM The figure compares the individual store write metrics with the existing node-wide disk write metrics for node 3 in the cluster and shows that the store metrics almost add up to the system metrics.

@CheranMahalingam CheranMahalingam marked this pull request as ready for review March 11, 2024 19:46
@CheranMahalingam CheranMahalingam requested review from a team as code owners March 11, 2024 19:46
@CheranMahalingam CheranMahalingam requested review from itsbilal, abarganier, jbowens and aadityasondhi and removed request for a team March 11, 2024 19:46
@CheranMahalingam CheranMahalingam linked an issue Mar 11, 2024 that may be closed by this pull request
Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm_strong:

Reviewed 1 of 4 files at r4, 1 of 12 files at r5.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aadityasondhi, @abarganier, and @itsbilal)

@CheranMahalingam
Copy link
Contributor Author

bors r=jbowens,abarganier

@craig
Copy link
Contributor

craig bot commented Mar 18, 2024

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 18, 2024

Build failed (retrying...):

@jbowens
Copy link
Collaborator

jbowens commented Mar 18, 2024

bors r-

@CheranMahalingam I think you need to rebase over master.

@craig
Copy link
Contributor

craig bot commented Mar 18, 2024

Canceled.

Currently, timeseries metrics are collected on a 10s interval which
hides momentary spikes in IO operations. This commit introduces a disk
monitoring system that allows callers to subscribe to stats for a block
device sampled every 100ms.

Epic: None.
Release note: None.
Currently, admission control consumes disk bandwidth stats aggregated
across all block devices, including noise introduced by reads/writes
from unrelated processes. This commit adds support for aggregating
disk bandwidth stats across only monitored block devices which are used
by the cockroach process.

Epic: None.
Release note: None.
Currently, disk metrics are computed and aggregated at a node level.
However, a cockroach node can run multiple stores. This commit
adds new timeseries disk metrics computed per-store.

Epic: None.
Release note (general change): The following metrics were added for
observability of per-store disk events:
- storage.disk.read.count
- storage.disk.read.bytes
- storage.disk.read.time
- storage.disk.write.count
- storage.disk.write.bytes
- storage.disk.write.time
- storage.disk.io.time
- storage.disk.weightedio.time
- storage.disk.iopsinprogress

The metrics match the definitions of the sys.host.disk.* system metrics.
@CheranMahalingam
Copy link
Contributor Author

bors r=jbowens,abarganier

@craig
Copy link
Contributor

craig bot commented Mar 18, 2024

@craig craig bot merged commit 4deb9e3 into cockroachdb:master Mar 18, 2024
22 checks passed
@CheranMahalingam CheranMahalingam deleted the granular_per_store_metrics branch March 18, 2024 20:41
CheranMahalingam added a commit to CheranMahalingam/cockroach that referenced this pull request Mar 25, 2024
This commit cleans up changes from cockroachdb#119885. There is no longer a need for
users to specify a disk name when specifying the provisioned bandwidth
since we can now automatically infer disk names from the `StoreSpec.Path`
and the underlying block device.

Informs: cockroachdb#86857.

Epic: None.
Release note (ops change): The provisioned-rate field, if specified,
should no longer accept a disk-name or an optional bandwidth field. To
use the disk bandwidth constraint the store-spec must contain
provisioned-rate=bandwidth=<bandwidth-bytes/s>, otherwise the cluster
setting kv.store.admission.provisioned_bandwidth will be used.
craig bot pushed a commit that referenced this pull request Mar 26, 2024
120895: admission: remove `DiskName` from `StoreSpec.ProvisionedRateSpec` r=sumeerbhola a=CheranMahalingam

This commit cleans up changes from #119885. There is no longer a need for users to specify a disk name when specifying the provisioned bandwidth since we can now automatically infer disk names from the `StoreSpec.Path` and the underlying block device.

Informs: #86857.

Epic: None.
Release note (ops change): The provisioned-rate field, if specified, should no longer accept a disk-name or an optional bandwidth field. To use the disk bandwidth constraint the store-spec must contain provisioned-rate=bandwidth=<bandwidth-bytes/s>, otherwise the cluster setting kv.store.admission.provisioned_bandwidth will be used.

Co-authored-by: Cheran Mahalingam <cheran.mahalingam@cockroachlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage: granular IO metrics storage: investigate host-level I/O metrics; consider per-store
4 participants