#In my application, I am using websockets to generate TTS. Can you explain exactly how concurrency i

1 messages · Page 1 of 1 (latest)

covert sparrowBOT
#
AI-generated Answer for larrycmz_02653

The number of concurrent WebSocket connections you can have depends on your subscription plan. Each plan has specific limits on how many concurrent requests you can make. If you need higher concurrency than your current plan allows, you might consider contacting the Enterprise team to discuss a custom plan that fits your needs.

steep merlin
#

Let's say I'm using the pro plan. How many concurrent websocket connections can I have, assuming that none are making a request?

covert sparrowBOT
#
AI-generated Answer for larrycmz_02653

When using WebSockets for Text-to-Speech (TTS) generation with ElevenLabs, the concurrency limits are based on active requests rather than open connections. This means that you can have multiple WebSocket connections open simultaneously, but the limit applies to the number of concurrent TTS generation requests being processed.

For the Pro plan, you are allowed 10 concurrent requests. This means you can have up to 10 active TTS generation tasks running at the same time through WebSocket connections.

To clarify:

  1. You can open more than 10 WebSocket connections if needed.
  2. The limit of 10 applies to active TTS generation requests, not idle connections.
  3. If you have 10 open WebSocket connections but none are actively generating TTS, you haven't used any of your concurrency limit.

It's important to note that if you exceed the concurrency limit, additional requests will be rejected until one of the active requests completes. To manage this, you might consider implementing a queuing system on your end to handle requests that exceed the concurrency limit.

If you find that the Pro plan's concurrency limit is not sufficient for your needs, you may want to consider contacting the Enterprise team to discuss a custom plan with higher limits tailored to your specific requirements.

steep merlin
#

Is there a limit to the number of idle websocket connections I can have concurrently?

covert sparrowBOT
#
AI-generated Answer for larrycmz_02653

When using WebSocket connections for text-to-speech generation with ElevenLabs, the concurrency limit is based on the number of active WebSocket connections, regardless of whether they are actively making requests or idle.

For the Pro plan, you can have up to 10 concurrent WebSocket connections open at any given time. This means:

  1. You can maintain up to 10 WebSocket connections simultaneously, even if they are all idle and not actively generating speech.
  2. If you attempt to open an 11th connection while already having 10 active connections, the request will be rejected due to exceeding the concurrency limit.

It's important to note that there is no separate limit for idle connections. The concurrency limit applies to the total number of open WebSocket connections, whether they are actively generating speech or sitting idle.

To optimize your usage:

  1. Consider closing idle connections if you don't need them to stay open for extended periods.
  2. Implement a connection pooling mechanism to efficiently manage your WebSocket connections within the allowed limit.
  3. If you find that you consistently need more than 10 concurrent connections, you may want to contact the Enterprise Department to discuss a custom plan that could accommodate higher concurrency limits.

Remember that while there's a limit on concurrent connections, there's no limit on the total number of requests you can make as long as you stay within the concurrency limit and have sufficient credits in your account.

steep merlin
#

My understanding is that a request consists of a few stages. 1. Sending the text. 2. The audio generation. 3. The audio streaming. Is this correct? And, if so, what portion of this counts towards concurrency?

covert sparrowBOT
#
AI-generated Answer for larrycmz_02653

Yes, your understanding is correct. A request typically involves the following stages:

  1. Sending the text: The text is sent to the TTS service via the WebSocket connection.
  2. Audio generation: The service processes the text and generates the audio.
  3. Audio streaming: The generated audio is streamed back to the client.

For concurrency limits, only the audio generation and audio streaming stages count towards the concurrent request limits of your plan. Simply having an idle WebSocket connection or sending text without initiating audio generation does not count as an active concurrent request.

For example, on the Pro plan, you can have up to 20 concurrent requests using Flash/Turbo models and up to 10 concurrent requests with other models. If you exceed these limits, you would need to queue requests or consider upgrading to a higher plan.

steep merlin
#

What if the audio generation completes while the audio is still streaming. Is the request still actively using my concurrency limit until the streaming completes?

covert sparrowBOT
#
AI-generated Answer for larrycmz_02653

Yes, the request will continue to count towards your concurrency limit until the entire process is complete, including the audio streaming. Even if the audio generation finishes, the connection remains active and contributes to your concurrency usage until the streaming is fully delivered.

steep merlin
#

Can you please point me to the specific documentation that explains this in detail?