_round_timestamp called too often

Bug #1562820 reported by gordon chung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
High
gordon chung

Bug Description

performance degradation occurs on metricd workers as the system accumulates more data. when profiling, round_timestamp is called tens of thousands or hundreds of thousands of times to process each metric. it represents the majority of workload

Revision history for this message
gordon chung (chungg) wrote :
Julien Danjou (jdanjou)
Changed in gnocchi:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Julien Danjou (jdanjou) wrote :

The way you wrote that report sounds like _round_timestamp() is getting slower and slower, which is more than unlikely.

It's true that 33% of the time is spent in _round_timestamp, which makes sense since it's called 100k time, which also "make sense" since it's used by groupby(). I imagine the time series tested had a few thousand datapoints?

I wonder if groupby() is not called on too many timestamps here. Unless you try to re-aggregate the *whole* time serie – which is *very* unlikely if you appened a few datapoints at the end, it should not be called so often.

Revision history for this message
gordon chung (chungg) wrote :

it is getting slower but it will speed up again eventually, and then slow down, etc... i'm guessing it's because at some point there is some expiration happening that makes it run _round_timestamp() less.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/299444

Changed in gnocchi:
assignee: nobody → gordon chung (chungg)
status: Triaged → In Progress
Revision history for this message
gordon chung (chungg) wrote :

yeah, so apparently we are re-aggregating the whole time serie....

Changed in gnocchi:
importance: Low → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (stable/2.0)

Fix proposed to branch: stable/2.0
Review: https://review.openstack.org/300529

Changed in gnocchi:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (master)

Reviewed: https://review.openstack.org/299444
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=3bdfaeb67e7041a0ea541143bd3cfc697d8ab5d4
Submitter: Jenkins
Branch: master

commit 3bdfaeb67e7041a0ea541143bd3cfc697d8ab5d4
Author: gordon chung <email address hidden>
Date: Wed Mar 30 09:34:40 2016 -0400

    resample only data affected by new measures

    currently, we are passing in the full unaggregated timeserie
    when we update each of the aggregates for each granularity.
    this is incorrect as the unaggregated timeserie corresponds to the
    largest granularity of the metric. this means that for smaller
    granularities, we are updating and resampling points that are already
    aggregated and not affected by new incoming measures.

    Change-Id: I687c2a18b332494f5c5cb7fdfe6f2b3d1e8de804
    Closes-Bug: #1562820

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (stable/2.0)

Reviewed: https://review.openstack.org/300529
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=abd58c762d4ea13d24a85f0a6969d31db15710bf
Submitter: Jenkins
Branch: stable/2.0

commit abd58c762d4ea13d24a85f0a6969d31db15710bf
Author: gordon chung <email address hidden>
Date: Wed Mar 30 09:34:40 2016 -0400

    resample only data affected by new measures

    currently, we are passing in the full unaggregated timeserie
    when we update each of the aggregates for each granularity.
    this is incorrect as the unaggregated timeserie corresponds to the
    largest granularity of the metric. this means that for smaller
    granularities, we are updating and resampling points that are already
    aggregated and not affected by new incoming measures.

    Change-Id: I687c2a18b332494f5c5cb7fdfe6f2b3d1e8de804
    Closes-Bug: #1562820
    (cherry picked from commit 3bdfaeb67e7041a0ea541143bd3cfc697d8ab5d4)

Julien Danjou (jdanjou)
Changed in gnocchi:
milestone: none → 2.1.0
status: Fix Committed → Fix Released
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.