pt-stalk purge_samples slows down checks

Bug #1046440 reported by Gavin Towey on 2012-09-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to
Fix Released
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 (fraserbn) on 2012-09-10
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
Brian Fraser (fraserbn) on 2012-11-12
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
Brian Fraser (fraserbn) on 2012-12-05
Changed in percona-toolkit:
status: Confirmed → In Progress
Brian Fraser (fraserbn) on 2012-12-11
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:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers