Project

General

Profile

Bug #14503

Listing reports for a host via API/hammer consumes large amount of memory

Added by Ivan Necas almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Performance
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1324461
Description of problem:

Depending on the size of reports for a host, the request for the reports
for a host via API/hammer consumes large amount of memory.

How reproducible:
the system needs to have reasonable history of puppet reports in order to reporduce the issue

Steps to Reproduce:
1. curl -k -u admin:changeme -H "Accept:application/json"\
https://foreman.example.com/api/v2/hosts/myhost.example.com/reports?per_page=120

Actual results:
The passenger process starts consuming a lot of memory and it takes tens of minuts to finish (if the server doesn't fail on insufficient amount of memory before it finishes).

Expected results:
The request returns reports for a host


Related issues

Related to Foreman - Bug #10053: Table lock hangs all processesClosed2015-04-07

Associated revisions

Revision aeba4f42 (diff)
Added by Ivan Necas almost 5 years ago

Fixes #14503 - don't join reports with the logs and resources explicitly in API

Using `.includes(:logs => [:message, :source])` in the search scope
for reports caused serious performance issues (ending up with server
taking all of its memory). I've found no reason for the `includes` to
actually be there (we don't render the logs in the views) and should
be safe to just remove it.

History

#1 Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3394 added

#2 Updated by Ivan Necas almost 5 years ago

  • Related to Bug #10053: Table lock hangs all processes added

#3 Updated by Marek Hulán almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 136

#4 Updated by Ivan Necas almost 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 4 years ago

  • Category set to Performance

Also available in: Atom PDF