loopbackio / loopbackio/loopback-next
Performance issues with lb4 services
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5.1k
- Forks
- 1.1k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 27
Beschreibung
Describe the bug
Using @service or @inject to inject services can lead to performance issues when calling api (although not using them).
i used autocannon for benchmarking
Full command: autocannon -t12 -c1000 -d30 http://localhost:3000/ping
I tried to inject services into the controller (ping.controller). The more services I import and the larger the project, the more req in seconds decreases
Logs
No response
Additional information
I ran the project on 8 CPUs and tried it multiple times. These are the average results I got.
- Without Injection
I ran the autocannon test and got around 680k requests in 30 seconds.- With `@service` (around 37 `@service` with the same service file)
I got around 420k requests in 30 seconds.- With `@inject` (around 37 `@inject` with the same service file)
I got around 600k requests in 30 seconds.Reproduction
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der verlinkten Reproduktion u3ih/loopback-benchmarking und deren ping.controller-Setup und führe dann den angegebenen autocannon-Befehl aus, um no injection, @service und @inject zu vergleichen. Als abgeschlossen gilt die Aufgabe, wenn die Ursache des Unterschieds bei der Request-Rate identifiziert und die gemeldete Performance-Regression behoben oder eindeutig charakterisiert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- node.js, typescript
- Bereich
- api, backend, performance
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 28/100