How to resolve Sprinto check for monitoring ElastiCache Current Connections
About
Sprinto Check: AWS ElastiCache Current Connections Monitoring
When integrating your AWS account with Sprinto, the platform automatically fetches the list of services. If you're using AWS ElastiCache and haven't set up a monitoring alert for the CurrConnections metric, Sprinto initiates this check for all ElastiCache clusters associated with your account.
Purpose
Monitoring the current connections in your AWS ElastiCache environment, specifically focusing on the CurrConnections metric, is pivotal for ensuring optimal performance and efficient resource utilization. Sprinto promptly sends notifications if the current connections exceed the defined threshold, empowering you to take proactive measures to maintain peak performance.
Note: At this time, our platform does not support AWS CloudWatch Composite Alarms or Math-Based Alarms.
This means you cannot create alarms that:
Combine multiple alarms using logical conditions (e.g., ALARM1 AND ALARM2
)
Use metric math expressions (e.g., calculating averages or deltas across metrics)
How to Resolve
To address this check, follow these steps to create an AWS CloudWatch alert for monitoring AWS ElastiCache current connections.
Before you Begin
Ensure you have "Admin" access on the AWS account to create alerts.
Confirm the existence of ElastiCache clusters on your AWS account for which you want to set up alerts.
Log in to Sprinto as an administrator.
Create Monitoring Alert
Log in to your AWS console using your credentials.
Navigate to the CloudWatch web service.
Go to Alarms > In Alarm, and click Create Alarm.
Click Select Metric.
On the Select Metric page, choose the AWS/ElastiCache namespace and select the CurrConnections metric.
Specify the metric and conditions to define the alert trigger point, then click Next.
On the Configure Action page:
Create New Topic: Enter the topic name and email address for alert notifications.
Add Notification: Select the created SNS topic and click Add Notification.
Enter a name and description for the created alert, then click Next.
Preview your created alarm, and if necessary, edit any parameters before clicking Create Alarm.
Once the monitoring alert is set up on CloudWatch for ElastiCache's current connections, Sprinto retrieves the changes, and the Sprinto check status is marked as "Passing."
For additional assistance with the Sprinto check, please reach out to Sprinto Support. We're here to help!
Benefits of Using CloudWatch with ElastiCache
ElastiCache provides enhanced visibility through CloudWatch, offering key performance metrics for your resources. CloudWatch alarms empower you to set thresholds on metrics, triggering notifications when preventive actions are required.
Monitoring trends over time is essential for detecting workload growth. CloudWatch offers data points for up to 455 days (15 months), allowing you to glean insights and forecast resource utilization over an extended period.
Connections Metrics in CloudWatch
CloudWatch provides two crucial metrics for monitoring connections to your ElastiCache cluster:
CurrConnections: This represents the number of concurrent and active connections registered by the Redis engine. Derived from the connected_clients property in the Redis INFO command.
NewConnections: Indicates the total number of connections accepted by Redis over a specified period, regardless of their current status. This metric is also derived from the Redis INFO command.
Understanding Connection Limits
It's vital to note that Redis imposes a limit on simultaneous connections called max clients, set to a default and non-modifiable value of 65,000 per node in ElastiCache.
Both CurrConnections and NewConnections metrics play a crucial role in issue detection and prevention. For instance, a consistent increase in CurrConnections could lead to reaching the 65,000 connection limit, signaling a potential issue on the application side or improperly closed connections.
Proactive Measures and Best Practices
To address potential issues, investigate the application's behavior and consider the following best practices:
TCP-Keepalive: Ensure your cluster uses tcp-keepalive to detect and terminate potential dead peers. Adjust the tcp-keepalive timer in the cluster's parameter group.
Connection Reuse: Implement connection pooling in your application to avoid the extra cost of creating new connections. This can be achieved through your Redis client library, supported frameworks, or custom-built solutions.
Monitoring NewConnections
Monitoring NewConnections is essential for understanding the total connections created over time. Unlike CurrConnections, the maxclient limit doesn't apply to NewConnections, as it represents the total connections, not simultaneous ones. However, a high volume of rapidly opened and closed connections can impact node performance, adding extra payload for Redis operations.
Special Considerations for Encrypted Clusters
For clusters using ElastiCache in-transit encryption, it becomes crucial to control the volume of new connections. The encryption process adds extra time and CPU utilization during the TLS handshake.
Adhering to these best practices ensures effective monitoring, early issue detection, and optimal performance for your ElastiCache cluster when integrated with CloudWatch.