pt-stalk purge_samples slows down checks

Bug #1046440 reported by Gavin Towey
6
This bug affects 1 person
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.

Tags: pt-stalk

Related branches

Brian Fraser (fraserbn)
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)
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)
Changed in percona-toolkit:
status: Confirmed → In Progress
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: In Progress → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-577

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.