Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Guidelines for best practice - number of streamingRecognize requests per client? #284

Closed
kidplug opened this issue Jan 25, 2019 · 10 comments
Assignees
Labels
api: speech Issues related to the googleapis/nodejs-speech API. type: question Request for information or clarification. Not an issue.

Comments

@kidplug
Copy link

kidplug commented Jan 25, 2019

Is there any practical limit or best practice for using a single SpeechClient instance with many streamingRecognize requests running simultaneously?

Does the SpeechClient maintain a single underlying HTTP2 connection? Or does it spawn multiple connections once the number of HTTP2 channels/streams reaches a certain number?

Should I consider using multiple SpeechClients if I wanted to run 100 simultaneous streamingRecognize requests?

@julien-c
Copy link

Interested in this as well. By the way you'll hit the (default) request limit quota if you get to 100 simultaneous streaming requests: https://cloud.google.com/speech-to-text/quotas#request_limits

@kidplug
Copy link
Author

kidplug commented Jan 25, 2019

How do you figure?
I see request limit of:
Processing per 60 seconds | 6,480 seconds of audio

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Jan 26, 2019
@sduskis sduskis added type: question Request for information or clarification. Not an issue. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Feb 5, 2019
@nnegrey
Copy link
Contributor

nnegrey commented Jan 15, 2020

@bcoe maybe you know more?
But my understanding is that assuming you don't hit the max set by the server, then the client library should handle all this for you.

@bcoe
Copy link
Contributor

bcoe commented Jan 16, 2020

@murgatroid99 knows best; but if I recall past conversations, the same underlying connection will be used if accessing the same resource; Michael please correct me if I'm wrong.

@murgatroid99
Copy link

Yes, in most cases the gRPC client will use a single connection when making multiple requests to a single server. It is possible that the front end server will reject streams if too many streams are open simultaneously on a single connection. The gRPC library does not currently do anything about that; higher-level retry logic may or may not help with that problem.

@nnegrey
Copy link
Contributor

nnegrey commented Jan 17, 2020

@murgatroid99, would it be best then to open a new client for all streaming requests?

@google-cloud-label-sync google-cloud-label-sync bot added the api: speech Issues related to the googleapis/nodejs-speech API. label Jan 30, 2020
@nnegrey nnegrey closed this as completed Feb 5, 2020
@chiangky
Copy link

I have the same question too,
I want to call streamingRecognize concurrently, is it the only way to open the new client to proceed the second request (While the first request is still running) ?

@DevJhns
Copy link

DevJhns commented Feb 28, 2020

@kidplug @chiangky @nnegrey Hi! Have you tried it? I have same problem, tried running two streams on one speech client and tried creating two speech clients for both streams, in any case worked weired, like gcp had one buffer and all audio was messing up

@zxzzxxzx
Copy link

any progress with the issue? for example what if we start some speech recognition service in 2 different browser tabs simultaniously (using socket.io for communication with node.js server). Now, as it was said, it is not working well...

@lolz0r
Copy link

lolz0r commented Aug 31, 2020

I am also seeing an issue when running multiple streams at once.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: speech Issues related to the googleapis/nodejs-speech API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests