pt-stalk purge_samples slows down checks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Brian Fraser |
Bug Description
currently in pt-stalk, the purge_samples function is called between each check iteration. It's meant to clean up old oprofile samples. However there are a couple issues with this:
1. If you're running pt-stalk as a daemon, you may end up collecting a lot of oprofile data. The default retention time of 30 days leaves a lot of data.
2. When the data piles up, the find command takes 3-5 seconds to run. This means if you're trying to set --interval=1 then you don't actually check that frequently, and stalk starts missing events.
I think the solution is to move the purge_samples call to happen only after the trigger has been hit, and a sample has been collected. There is really no need to check and delete files every iteration because no new files have been added! The continuous find command just wastes time/cpu/io.
I could submit a patch, but the change is trivial, just move the current call to purge_samples up about 10 lines or so. I could submit a patch if you like, but I don't think it's needed in this case.
Related branches
- Brian Fraser (community): Approve
- Daniel Nichter: Approve
-
Diff: 34 lines (+10/-5)1 file modifiedbin/pt-stalk (+10/-5)
Changed in percona-toolkit: | |
assignee: | nobody → Brian Fraser (fraserbn) |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
tags: | added: pt-stalk |
Changed in percona-toolkit: | |
importance: | Wishlist → Undecided |
Changed in percona-toolkit: | |
milestone: | none → 2.1.7 |
Changed in percona-toolkit: | |
milestone: | 2.1.7 → 2.1.8 |
Changed in percona-toolkit: | |
importance: | Undecided → Medium |
Changed in percona-toolkit: | |
status: | Confirmed → In Progress |
Changed in percona-toolkit: | |
status: | In Progress → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-577