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

Add alerts for high osd cpu usage #2306

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion metrics/deploy/prometheus-ocs-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ spec:
floor((ocs_storage_provider_operator_version>0)/1000) - ignoring(storage_consumer_name) group_right() floor((ocs_storage_client_operator_version>0)/1000) > 1 or floor((ocs_storage_client_operator_version>0)/1000) - ignoring(storage_consumer_name) group_left() floor((ocs_storage_provider_operator_version>0)/1000) >= 1
labels:
severity: critical
- name: mds-performance-alerts.rules
- name: ceph-daemon-performance-alerts.rules
rules:
- alert: MDSCacheUsageHigh
annotations:
Expand All @@ -277,3 +277,12 @@ spec:
for: 5m
labels:
severity: critical
- alert: OSDCPULoadHigh
annotations:
description: High CPU usage in the OSD container on pod {{ $labels.pod }}. Please create more OSDs to increase performance
message: High CPU usage detected in OSD container on pod {{ $labels.pod}}.
severity_level: warning
Copy link
Member

Choose a reason for hiding this comment

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

please remember to add the new "runbook_url" annotation with the link to the alert doc file.

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a follow-up PR, since this is a new requirement.

expr: "pod:container_cpu_usage:sum{pod=~\"rook-ceph-osd-.*\"} > 0.35 \n"
Copy link
Contributor

Choose a reason for hiding this comment

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

why 0.35?

Copy link
Contributor Author

@weirdwiz weirdwiz Dec 8, 2023

Choose a reason for hiding this comment

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

i've set it to 35%, because in all of my tests the OSD cpu usage, hovered around 20%ish. in very very overloaded environments, the osds steadly increased cpu usage till 30-40%

the throughput and latency was very low during the overloaded environment, only increased when i deployed a larger cluster (also resulting in lower CPU usage)

for: 15m
labels:
severity: warning
17 changes: 16 additions & 1 deletion metrics/mixin/alerts/perf.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
prometheusAlerts+:: {
groups+: [
{
name: 'mds-performance-alerts.rules',
name: 'ceph-daemon-performance-alerts.rules',
rules: [
{
alert: 'MDSCacheUsageHigh',
Expand All @@ -17,6 +17,21 @@
message: 'High MDS cache usage for the daemon {{ $labels.ceph_daemon }}.',
description: 'MDS cache usage for the daemon {{ $labels.ceph_daemon }} has exceeded above 95% of the requested value. Increase the memory request for {{ $labels.ceph_daemon }} pod.',
severity_level: 'error',
}
},
{
alert: 'OSDCPULoadHigh',
expr: |||
pod:container_cpu_usage:sum{%(osdSelector)s} > 0.35
||| % $._config,
'for': $._config.osdCPULoadHighAlertTime,
labels: {
severity: 'warning',
},
annotations: {
message: 'High CPU usage detected in OSD container on pod {{ $labels.pod}}.',
description: 'High CPU usage in the OSD container on pod {{ $labels.pod }}. Please create more OSDs to increase performance',
severity_level: 'warning',
},
},
],
Expand Down
2 changes: 2 additions & 0 deletions metrics/mixin/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
_config+:: {
// Selectors are inserted between {} in Prometheus queries.
ocsExporterSelector: 'job="ocs-metrics-exporter"',
osdSelector: 'pod=~"rook-ceph-osd-.*"',

// Duration to raise various Alerts
clusterObjectStoreStateAlertTime: '15s',
Expand All @@ -14,6 +15,7 @@
blockedRBDClientAlertTime: '10s',
ocsStorageClusterKMSConnectionAlert: '5s',
mdsCacheUsageAlertTime: '5m',
osdCPULoadHighAlertTime: '15m',

// Constants
objectStorageType: 'RGW',
Expand Down