Project

General

Profile

Actions

Bug #17143

open

Performance degradation in "non-targeted" search through WebUI or API

Added by Konstantin Orekhov about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Search
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

After upgrading to 1.13.1, I immediately noticed the huge delays in search through the hosts in both WebUI and API (the latter is actually worse than WebUI). Here are few examples:

  1. time curl -kSs -u admin:$PASS https://localhost/api/hosts | jq '.' | grep total
    "total": 1695,
    "subtotal": 1695,

real 0m0.816s
user 0m0.040s
sys 0m0.076s

But the search through my 1695 hosts on this instances takes 2.5 minutes (!):

  1. time curl -kSs -u admin:$PASS https://localhost/api/hosts?search=test | jq '.' | grep total
    "total": 1695,
    "subtotal": 1,

real 2m25.147s
user 0m0.053s
sys 0m0.063s

Corresponding logs (WebUI search):

2016-10-28 18:39:29 a607439e [app] [I] Parameters: {"utf8"=>"✓", "search"=>"test"}
2016-10-28 18:40:16 a607439e [app] [I] Rendered hosts/_list.html.erb (10.1ms)
2016-10-28 18:40:16 a607439e [app] [I] Rendered hosts/index.html.erb within layouts/application (18.0ms)
2016-10-28 18:40:17 a607439e [app] [I] Rendered common/_searchbar.html.erb (11.6ms)
2016-10-28 18:40:17 a607439e [app] [I] Rendered layouts/_application_content.html.erb (12.2ms)
2016-10-28 18:40:17 a607439e [app] [I] Rendered home/_user_dropdown.html.erb (1.9ms)
2016-10-28 18:40:17 a607439e [app] [I] Read fragment views/tabs_and_title_records-6 (1.1ms)
2016-10-28 18:40:17 a607439e [app] [I] Rendered home/_topbar.html.erb (43.9ms)
2016-10-28 18:40:17 a607439e [app] [I] Rendered layouts/base.html.erb (45.5ms)
2016-10-28 18:40:17 a607439e [app] [I] Completed 200 OK in 47691ms (Views: 73.3ms | ActiveRecord: 47585.0ms)

API:
2016-10-29 13:44:51 8a9d5e4a [app] [I] Started GET "/api/hosts?search=test" for 127.0.0.1 at 2016-10-29 13:44:51 -0700
2016-10-29 13:44:51 8a9d5e4a [app] [I] Processing by Api::V2::HostsController#index as JSON
2016-10-29 13:44:51 8a9d5e4a [app] [I] Parameters: {"search"=>"test", "apiv"=>"v2"}
2016-10-29 13:44:51 8a9d5e4a [app] [I] Authorized user admin(Admin User)
2016-10-29 13:46:10 8a9d5e4a [app] [I] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (58.6ms)
2016-10-29 13:47:28 8a9d5e4a [app] [I] Completed 200 OK in 156710ms (Views: 62.3ms | ActiveRecord: 156519.5ms)

This was not the case in previous versions. "targeted" search (search=name~something) still works perfectly fine.
Is this an intended change in behavior?


Related issues 1 (0 open1 closed)

Related to Salt - Bug #17196: Add indexes to the host_salt_modules and hostgroup_salt_modules tablesClosedTomer Brisker11/03/2016Actions
Actions

Also available in: Atom PDF