Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Websocket concurrency issue With multi Modal Live API

Hey Community 
While using the gemini multi modal api with model Gemini 2.0 -Flash - exp. We are facing the below issue while using it via websockets, it sometimes work fine and sometimes it starts giving the below error, Can anyone guide us in implementing a solution for the below error or any one has faced the same issue.
here are the things we have done.
1. We have diagnosed it as a concurrency issue and also made sure that ws.close() is implemented after we close the page.
2. We don't have any websockets open on the client side because we have a single machine as of now connecting to the websockets 
3. Does any body know how much time it takes to close them automatically?

2025-03-05T15:51:18.731934634Z: [INFO]  2025-03-05 15:51:18,713 [ERROR] Error in server message handling: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se
2025-03-05T15:51:18.740701603Z: [INFO]  2025-03-05 15:51:18,714 [ERROR] WebSocket communication error: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se
2025-03-05T15:51:18.741891022Z: [INFO]  2025-03-05 15:51:18,739 [ERROR] WebSocket error: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se
2025-03-05T15:52:07.499886225Z: [ERROR]  INFO:     connection closed

0 1 1,450
1 REPLY 1