Project

General

Profile

action #94111

Optimize /api/v1/jobs

Added by tinita about 1 month ago. Updated 29 days ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
2021-06-16
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Currently that endpoint is accessible by everyone, and without parameters it returns up to 10k jobs.

Additionally it executes several SELECTS for each of the 10k jobs, resulting in about 40k.

This can take very long, for example I saw 150s on o3 today. So with only one HTTP request you can keep the webserver and DB occupied for 150s.

Ideas:

  • Test if the same optimization as in #93925 helps
  • Maybe choose a lower limit than 10k?
  • Restrict requests with a large limit to authenticated users

Related issues

Related to openQA Project - action #93925: Optimize SQL on /tests/overviewResolved2021-06-12

History

#1 Updated by tinita about 1 month ago

  • Related to action #93925: Optimize SQL on /tests/overview added

#2 Updated by cdywan 29 days ago

For comparison the Search route has a configurable rate limit based on a minion lock which is per user if logged in, or global otherwise. Additionally there's a configurable hard limit on the number of results. See lib/OpenQA/WebAPI/Controller/API/V1/Search.pm#L184.

Also available in: Atom PDF