Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1663

Implement retention by bytes for pt-stalk


    • New Feature
    • Status: Done
    • Medium
    • Resolution: Fixed
    • None
    • 3.1.0
    • pt-stalk
    • None


      Currently, there is no good way of limiting and reuse the amount of space that pt-stalk can consume. There are following tunables: 
      But they only allow pt-stalk logs to not occupy all the space, and once it does it simply stops working until retention time passes for the first log.

      Ideally, as SREs responsible for the service we would like to have an ability to limit the total amount of bytes that pt-stalk can consume, and after it goes over that limit it should switch to a ring buffer of logs, removing the oldest logs.

      Is it possible to implement "retention-bytes" for explicitly limiting the space usage or at least "retention-count" to limit the number of traces that pt-stalk can handle.


      1. Implement --retention-size option
      2. Implement --retention-count option

      Retention Size

      Limit the amount of space consumed by pt-stalk files based on size measurement of a directory.

      Applies only to files under --dest

      Pass in a friendly measurements using integer + letter, for example k, M, G, and T. 

      Default is 500M

      --retention-size=1G # Don't collect further if we've used 1GB of space 

      Retention Count

      Limit the amount of space consumed by pt-stalk files based on measuring count of collections performed.

      Applies only to files under --dest

      Accepts an integer value only.

      --retention-count=100 # Collect up to 100 collects




            carlos.salguero Carlos Salguero (Inactive)
            charly.batista Charly Batista
            0 Vote for this issue
            4 Start watching this issue



              Smart Checklist