Skip to content

Clients_too_many error experienced with 7 or more concurrent AWS Lightsail instances

0

Originally, we have created 12 AWS Lightsail instances in 2 regions (10, 2 instances each) and 3 zones (7, 3, 2 instances each). Each instance has 2GB of runtime memory (US$22 plan). We have set up one dedicated instance for one IAM user. Some of our users experienced Clients_too_many error when 7 concurrent instances are in used. We tried to reboot the blocked instances and it seemed that a long period after the reboot this error was cleared. At first, we thought that maybe we were having too many instances and so we removed one inactive instance from the first region (6 instances) and now we are down to 11 instances in total. But the error persisted. One suggestion is that we have exceeded the quota for connecting to a Redis server. But none of our instances is using SQL database and we don't think that that is the cause of the error. Are we exceeding some resource limits when 7 or more users are actively using their allocated instances? Are there too many instances (default 20)/account and/or too many concurrent browser-based ssh sessions (up to 8 or 9)/region/account?

asked a year ago235 views

2 Answers
0
Accepted Answer

Based on the information provided, the "Clients_too_many" error you're experiencing is likely related to the "ERR max number of clients reached" error in Redis, which occurs when a cluster node reaches its maximum connection quota.

However, there's a misunderstanding in your assessment. You mentioned that none of your instances is using an SQL database, but Redis is not an SQL database - it's an in-memory data structure store often used as a database, cache, or message broker. Lightsail instances may be using Redis in the background for certain services or applications running on your instances.

When you have 7 or more concurrent instances in use, you might be hitting connection limits to a Redis service that's running as part of your application stack or system services. This would explain why rebooting temporarily resolves the issue, as it closes existing connections.

To resolve this issue, you could:

  1. Check the CurrConnections metric to confirm if you're hitting the "maxclients" quota
  2. Implement connection pooling to reuse connections
  3. Set appropriate timeout values in your client configuration
  4. Configure clients to connect directly to read replicas for read operations to distribute the load

Regarding your question about resource limits, Lightsail does have a default quota of 20 instances per AWS account, but you're well under that with 11 instances. For browser-based SSH sessions, there might be limits, but the error you're seeing is more likely related to Redis connection limits rather than SSH session limits.

If you continue experiencing issues, you might want to consider upgrading your instances to a larger plan with more resources, or optimizing your application to reduce the number of connections being made to Redis services.
Sources
Troubleshoot error messages in ElastiCache Redis clients | AWS re:Post
AWS lightsail need reboot every ten hours | AWS re:Post
Troubleshoot Lightsail load balancer issues - Amazon Lightsail

answered a year ago

  • Is there a service quota that restricts the active browser-based ssh sessions per region per account to 5?

0

Hi Eddie,

Thank you for reaching out regarding this matter.

Amazon Lightsail enforces limits on concurrent browser-based SSH/RDP sessions to ensure optimal performance and resource allocation. The current limits are:

  • RDP connections: 1 concurrent session per region
  • SSH connections: 5 concurrent sessions per region

These limits apply specifically to the browser-based terminal client within the Lightsail console. For detailed information about all service quotas, please refer to the Service Quotas section in our documentation: https://docs.aws.amazon.com/general/latest/gr/lightsail.html#limits_lightsail

If you need to establish additional connections beyond these limits, you can use standard SSH/RDP clients directly to your instances using their public IP addresses.

Please let me know if you have any additional questions or if there's anything else I can help clarify.

Best regards, Yujie

AWS
MODERATOR

answered a year ago

  • I want to clarify further. Currently, we have 11 AWS Lightsail instances spreading over 2 regions and 3 zones. And we have 9 active users. Each of them is using the AWS Browser-based RDP client to access his/her allocated instance. That means at peak time, there will be 9 separate Browser-based RDP sessions running in 9 separate instances. And with around 7 users accessing 7 separate instances, some of them got the Clients_too_many error. Does any of the above limits apply? We are neither using 9 different sessions to access the same instance nor using one IAM user to access 9 different instances concurrently. Kind regards, Eddie

  • Hi Eddie, the 5 concurrent session limit applies region-wide across all instances. In your case, only 5 users can simultaneously connect to Windows instances within the entire region - even if each user connects to their own separate instance. Additionally, each individual Windows instance supports only one user session at a time, so multiple users cannot share a single instance concurrently.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.