[ceilometer] Map-Reduce in resource-list command works long and blocks the db

Bug #1528296 reported by Ilya Tyaptin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Status tracked in 10.0.x
10.0.x
Invalid
High
MOS Ceilometer
7.0.x
Fix Released
High
MOS Maintenance
8.0.x
Fix Released
High
Igor Degtiarov
9.x
Fix Released
High
MOS Ceilometer

Bug Description

Currently for time request for resources we make a Map Reduce job on the all metering table (many GB in the longevity environments) that take a long time.

In the MongoDB 2.6+ we can avoid Map-Reduce and use find request instead. It will improve performance of this api request and doesn't block the database.

Ilya Tyaptin (ityaptin)
Changed in mos:
assignee: nobody → Ilya Tyaptin (ityaptin)
milestone: none → 8.0
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (openstack-ci/fuel-8.0/liberty)

Fix proposed to branch: openstack-ci/fuel-8.0/liberty
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/14893

Changed in mos:
status: New → In Progress
Changed in mos:
importance: Undecided → High
ruhe (ruhe)
tags: added: ceilometer
Revision history for this message
Nadya Privalova (nprivalova) wrote :

Not merged in upstream. Plan to merge in upstream first and probably go to 9.0 and back port to 8.0

Changed in mos:
status: In Progress → Invalid
tags: added: customer-found support
Revision history for this message
Dmitry Sutyagin (dsutyagin) wrote :

reproducible in MOS 7.0

Due to slow reply from /resources call with additional filter by timestamp (65 seconds in a specific case), it times out via haproxy, which causes relevant OSTF tests to fail

Changed in mos:
status: Invalid → Confirmed
tags: added: ct2
Revision history for this message
Bug Checker Bot (bug-checker) wrote : Autochecker

(This check performed automatically)
Please, make sure that bug description contains the following sections filled in with the appropriate data related to the bug you are describing:

actual result

expected result

steps to reproduce

For more detailed information on the contents of each of the listed sections see https://wiki.openstack.org/wiki/Fuel/How_to_contribute#Here_is_how_you_file_a_bug

tags: added: need-info
tags: added: area-ceilometer
removed: ceilometer
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (openstack-ci/fuel-7.0/2015.1.0)

Fix proposed to branch: openstack-ci/fuel-7.0/2015.1.0
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/21123

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (9.0/mitaka)

Fix proposed to branch: 9.0/mitaka
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/21129

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/ceilometer (9.0/mitaka)

Reviewed: https://review.fuel-infra.org/21129
Submitter: Pkgs Jenkins <email address hidden>
Branch: 9.0/mitaka

Commit: 3d5380f87284da36308c81fabda61b8e76505ee2
Author: Ilya Tyaptin <email address hidden>
Date: Mon May 23 12:42:46 2016

Avoid Map-Reduce job during the get_resource

For avoiding map-reduce in the resource list requests
we add a atomic operations for update first_sample_timestamp and
last_sample_timestamp and make a find request on resource collection.

Time range in this query affects both last sample timestamp and
matches only timestamps which exist in requested period.

        +-----------------+
        | |
+------------------------------------+ R1
        | |
+-----------------+ | R2
        | |
        | +-------------+ R3
        | |
+-----+ | | R4
        | |
        | | +------+ R5
        | |
        +-----------------+

        Request timestamp range

Only resources R1, R2 and R3 will be returned.

Co-Authored-By: Igor Degtiarov <email address hidden>

Change-Id: I9f6787219e4ec04ab8eca11bcf4867d0f8becdc9
Closes-bug: #1528296
Cherry-picked from 92b61b8

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/ceilometer (openstack-ci/fuel-8.0/liberty)

Reviewed: https://review.fuel-infra.org/14893
Submitter: Pkgs Jenkins <email address hidden>
Branch: openstack-ci/fuel-8.0/liberty

Commit: 4d9271621211d8532022ab3d76c9a68e592b61b8
Author: Ilya Tyaptin <email address hidden>
Date: Fri May 20 12:55:54 2016

Avoid Map-Reduce job during the get_resource

For avoiding map-reduce in the resource list requests
we add a atomic operations for update first_sample_timestamp and
last_sample_timestamp and make a find request on resource collection.

Time range in this query affects both last sample timestamp and
matches only timestamps which exist in requested period.

        +-----------------+
        | |
+------------------------------------+ R1
        | |
+-----------------+ | R2
        | |
        | +-------------+ R3
        | |
+-----+ | | R4
        | |
        | | +------+ R5
        | |
        +-----------------+

        Request timestamp range

Only resources R1, R2 and R3 will be returned.

Co-Authored-By: Igor Degtiarov <email address hidden>

Change-Id: I9f6787219e4ec04ab8eca11bcf4867d0f8becdc9
Closes-bug: #1528296

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/ceilometer (openstack-ci/fuel-7.0/2015.1.0)

Reviewed: https://review.fuel-infra.org/21123
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-ci/fuel-7.0/2015.1.0

Commit: 254106e8dafe9c5369522691de9d63c82a2da8aa
Author: Ilya Tyaptin <email address hidden>
Date: Tue May 31 14:55:19 2016

Avoid Map-Reduce job during the get_resource

For avoiding map-reduce in the resource list requests
we add a atomic operations for update first_sample_timestamp and
last_sample_timestamp and make a find request on resource collection.

Time range in this query affects both last sample timestamp and
matches only timestamps which exist in requested period.

        +-----------------+
        | |
+------------------------------------+ R1
        | |
+-----------------+ | R2
        | |
        | +-------------+ R3
        | |
+-----+ | | R4
        | |
        | | +------+ R5
        | |
        +-----------------+

        Request timestamp range

Only resources R1, R2 and R3 will be returned.

Co-Authored-By: Igor Degtiarov <email address hidden>

Change-Id: I9f6787219e4ec04ab8eca11bcf4867d0f8becdc9
Closes-bug: #1528296
Cherry-picked from 92b61b8

Dmitry (dtsapikov)
tags: added: on-verification
Dmitry (dtsapikov)
tags: removed: on-verification
Revision history for this message
Dmitry (dtsapikov) wrote :

Verified on 7.0+mu4

Script
https://github.com/vitalygusev/ceilo-scripts/blob/master/mongo-generator.py

was used with parameters:

--users 10 --projects 10 --resources_per_user_project 10 --samples_per_user_project 10

Performance was checked using:

ceilometer resource-list -l 100 | wc -l
ceilometer resource-list -q

Revision history for this message
Artem Minasyan (aminasyan) wrote :
Dmitry (dtsapikov)
tags: added: on-verification
Revision history for this message
Dmitry (dtsapikov) wrote :

Verified on 8.0+mu2

tags: removed: on-verification
Revision history for this message
Nadya Privalova (nprivalova) wrote :

I have added '10.0-reviewed' tag not to forget to include this into Newton-based product. We cannot merge this change to upstream because of Mongo version (2.6 cannot be supported in CI, but this change requires 2.6 at least).

tags: added: 10.0-reviewed
Revision history for this message
Nastya Urlapova (aurlapova) wrote :

Since we don't support Ceilo in 10.0 issue was moved to Invalid.

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (mcp/newton)

Fix proposed to branch: mcp/newton
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/33379

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (11.0/ocata)

Fix proposed to branch: 11.0/ocata
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/33777

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/ceilometer (mcp/ocata)

Fix proposed to branch: mcp/ocata
Change author: Ilya Tyaptin <email address hidden>
Review: https://review.fuel-infra.org/34487

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/ceilometer (mcp/newton)

Change abandoned by Ilya Tyaptin <email address hidden> on branch: mcp/newton
Review: https://review.fuel-infra.org/33379

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/ceilometer (mcp/ocata)

Change abandoned by Ilya Tyaptin <email address hidden> on branch: mcp/ocata
Review: https://review.fuel-infra.org/34487

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/ceilometer (11.0/ocata)

Change abandoned by Roman Podoliaka <email address hidden> on branch: 11.0/ocata
Review: https://review.fuel-infra.org/33777
Reason: we don't use 11.0/ocata anymore - mcp/ocata is the correct branch name

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.