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

Update the size of PersistentVolume Prometheus uses #2314

Merged
merged 1 commit into from Jul 27, 2021

Conversation

nakabonne
Copy link
Member

@nakabonne nakabonne commented Jul 27, 2021

What this PR does / why we need it:
This PR changes the Prometheus retention to 1w and disk size of PersistentVolume

How many times does Prometheus pull within a week?
Prometheus tries to pull per 60 seconds so:
604800s(=1w) / 60 = 10080

The number of series is currently:
count({__name__=~“.+“}) 57114

How many samples should Prometheus hold?
57114 * 10080 = 575,709,120

How much space should we prepare?
On average, Prometheus uses only around 1-2 bytes per sample. All are 2bytes in worst case scenario.
575,709,120 * 2 = 1,151,418,240 bytes ≈ 1.072 GB

Plus there are others like indexes so we need about 1.2GB at this point.

It's enough to have 2Gi so far. But we can't expect the size of cluster stats because it's depending on the cluster Pipecd runs on. Besides, considering the possibility of getting more time series (as it's in the middle of improving), I settled on allocating 4Gi for now. For those who use a huge cluster that makes series cardinality higher, it's good to change the size through the Helm value.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.76%. This pull request does not change code coverage.

@khanhtc1202
Copy link
Member

Thx for clarifying 👍
/lgtm

@nakabonne
Copy link
Member Author

nakabonne commented Jul 27, 2021

FYI: The current used space of the disk where age is 64d and its Prometheus retention is 15d is 2.47GB.
image
This is reported by: sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{persistentvolumeclaim="pipecd-prometheus-server"})

The retention will be half, so my calculation seems almost correct.

@nghialv
Copy link
Member

nghialv commented Jul 27, 2021

Nice. Let's go!
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants