googleapis / googleapis/google-cloud-node

missing projectId in @googlemaps clients causes crazy slow requests

Aperta
#6,935 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
priority: p2
Lingua principale
TypeScript
Stelle
3.2k
Fork
712
Merge medio
2g 9h
PR unite (30g)
104

Descrizione

### Please make sure you have searched for information in the following guides.

- [x] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- [x] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- [x] Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- [x] Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- [x] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- [x] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- [x] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
- [x] Check the API's issue tracker: https://cloud.google.com/support/docs/issue-trackers

### A screenshot that you have tested with "Try this API".

I don't know what I'm supposed to provide in this field.

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.

https://github.com/timm-stelzer-e-farm/reproduce-slow-google-apis

### A step-by-step description of how to reproduce the issue, based on the linked reproduction.

Follow the steps in the repository README and observe the terminal output.

### A clear and concise description of what the bug is, and what you expected to happen.

Omitting the `projectId` when constructing clients from `@googlemaps/*` (well, I only tested with routing and places), and only using an `apiKey` leads to incredibly slow and inconsistent requests. I've seen individual requests take up to 16s. The base-line seems to be between 3-4s.

When passing the `projectId`, in addition to the `apiKey`, the requests are reasonably fast, e.g. between 150ms and 400ms.

### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

It is not clear to me why not passing the `projectId` would cause this behavior, especially since the requests are evidently working _without_ it (they are just slow AF).

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal README del repository di riproduzione collegato ed esegui i relativi passaggi per confrontare le richieste effettuate con e senza projectId. Traccia i client @googlemaps utilizzati per il routing e le places, quindi determina perché le richieste che usano solo una chiave API sono lente. Il lavoro è completato quando la causa è stata identificata e il comportamento di latenza segnalato è stato corretto o chiaramente spiegato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
node.js, typescript
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.