kernelci / kernelci/kernelci-api

API limit restrict output to user, but doesn't restrict amount of data from mongodb

Ouverte
#549 8 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug critical techdebt
Langage dominant
Python
Étoiles
10
Forks
21
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

If we do two queries:
curl "https://staging.kernelci.org:9000/latest/nodes?kind=test&limit=1"
real 0m5.994s
user 0m0.012s
sys 0m0.000s

curl "https://staging.kernelci.org:9000/latest/nodes?kind=checkout&limit=1"
real 0m0.023s
user 0m0.012s
sys 0m0.000s

We can notice significant difference in response time. While it should be fast both (kind is indexed).

On preliminary investigation reason is that search query submitted to mongodb without limit parameter, which is causing very large output in case of some queries.
We need to resolve that, as it is also causing excessive load on database and ram consumption.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start by tracing the /latest/nodes endpoint and its MongoDB query, using the two curl examples to compare kind=test and kind=checkout with limit=1. Confirm that the requested limit reaches the database query, then verify response timing and database resource use for both cases.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
mongodb, python
Domaine
api, backend, databases
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.