This publish was written by Eunice Aguilar and Francisco Rodera from REA Group.
Enterprises that must share and entry giant quantities of information throughout a number of domains and companies must construct a cloud infrastructure that scales as want modifications. REA Group, a digital enterprise that makes a speciality of actual property property, solved this drawback utilizing Amazon Managed Streaming for Apache Kafka (Amazon MSK) and an information streaming platform referred to as Hydro.
REA Group’s group of greater than 3,000 folks is guided by our objective: to alter the way in which the world experiences property. We assist folks with all points of their property expertise—not simply shopping for, promoting, and renting—by way of the richest content material, knowledge and insights, valuation estimates, and residential financing options. We ship unparalleled worth to our prospects, Australia’s actual property brokers, by offering entry to the biggest and most engaged viewers of property seekers.
To realize this, the completely different technical merchandise throughout the firm frequently want to maneuver knowledge throughout domains and companies effectively and reliably.
Inside the Information Platform group, we’ve got constructed an information streaming platform referred to as Hydro to offer this functionality throughout the entire group. Hydro is powered by Amazon MSK and different instruments with which groups can transfer, rework, and publish knowledge at low latency utilizing event-driven architectures. Such a construction is foundational at REA for constructing microservices and well timed knowledge processing for real-time and batch use circumstances like time-sensitive outbound messaging, personalization, and machine studying (ML).
On this publish, we share our strategy to MSK cluster capability planning.
The issue
Hydro manages a large-scale Amazon MSK infrastructure by offering configuration abstractions, permitting customers to give attention to delivering worth to REA with out the cognitive overhead of infrastructure administration. As the usage of Hydro grows inside REA, it’s essential to carry out capability planning to fulfill person calls for whereas sustaining optimum efficiency and cost-efficiency.
Hydro makes use of provisioned MSK clusters in growth and manufacturing environments. In every setting, Hydro manages a single MSK cluster that hosts a number of tenants with differing workload necessities. Correct capability planning makes certain the clusters can deal with excessive site visitors and supply all customers with the specified degree of service.
Actual-time streaming is a comparatively new know-how at REA. Many customers aren’t but aware of Apache Kafka, and precisely assessing their workload necessities will be difficult. Because the custodians of the Hydro platform, it’s our duty to discover a solution to carry out capability planning to proactively assess the affect of the person workloads on our clusters.
Objectives
Capability planning includes figuring out the suitable dimension and configuration of the cluster based mostly on present and projected workloads, in addition to contemplating components resembling knowledge replication, community bandwidth, and storage capability.
With out correct capability planning, Hydro clusters can change into overwhelmed by excessive site visitors and fail to offer customers with the specified degree of service. Subsequently, it’s crucial to us to speculate time and sources into capability planning to verify Hydro clusters can ship the efficiency and availability that fashionable purposes require.
The capability planning strategy we observe for Hydro covers three important areas:
- The fashions used for the calculation of present and estimated future capability wants, together with the attributes used as variables in them
- The fashions used to evaluate the approximate anticipated capability required for a brand new Hydro workload becoming a member of the platform
- The tooling out there to operators and custodians to evaluate the historic and present capability consumption of the platform and, based mostly on them, the out there headroom
The next diagram exhibits the interplay of capability utilization and the precalculated most utilization.
Though we don’t have this functionality but, the objective is to take this strategy one step additional sooner or later and predict the approximate useful resource depletion time, as proven within the following diagram.
To verify our digital operations are resilient and environment friendly, we should preserve a complete observability of our present capability utilization. This detailed oversight permits us not solely to know the efficiency limits of our current infrastructure, but in addition to establish potential bottlenecks earlier than they affect our companies and customers.
By proactively setting and monitoring well-understood thresholds, we will obtain well timed alerts and take essential scaling actions. This strategy makes certain our infrastructure can meet demand spikes with out compromising on efficiency, finally supporting a seamless person expertise and sustaining the integrity of our system.
Answer overview
The MSK clusters in Hydro are configured with a PER_TOPIC_PER_BROKER
degree of monitoring, which offers metrics on the dealer and matter ranges. These metrics assist us decide the attributes of the cluster utilization successfully.
Nonetheless, it wouldn’t be smart to show an extreme variety of metrics on our monitoring dashboards as a result of that might result in much less readability and slower insights on the cluster. It’s extra priceless to decide on essentially the most related metrics for capability planning moderately than displaying quite a few metrics.
Cluster utilization attributes
Based mostly on the Amazon MSK greatest practices pointers, we’ve got recognized a number of key attributes to evaluate the well being of the MSK cluster. These attributes embrace the next:
- In/out throughput
- CPU utilization
- Disk area utilization
- Reminiscence utilization
- Producer and client latency
- Producer and client throttling
For extra data on right-sizing your clusters, see Finest practices for right-sizing your Apache Kafka clusters to optimize efficiency and value, Finest practices for Normal brokers, Monitor CPU utilization, Monitor disk area, and Monitor Apache Kafka reminiscence.
The next desk incorporates the detailed checklist of all of the attributes we use for MSK cluster capability planning in Hydro.
Attribute Identify | Attribute Kind | Items | Feedback |
---|---|---|---|
Bytes in | Throughput | Bytes per second | Depends on the combination Amazon EC2 community, Amazon EBS community, and Amazon EBS storage throughput |
Bytes out | Throughput | Bytes per second | Depends on the combination Amazon EC2 community, Amazon EBS community, and Amazon EBS storage throughput |
Client latency | Latency | Milliseconds | Excessive or unacceptable latency values often point out person expertise degradation earlier than reaching precise useful resource (for instance, CPU and reminiscence) depletion |
CPU utilization | Capability limits | % CPU person + CPU system | Ought to keep below 60% |
Disk area utilization | Persistent storage | Bytes | Ought to keep below 85% |
Reminiscence utilization | Capability limits | % Reminiscence in use | Ought to keep below 60% |
Producer latency | Latency | Milliseconds | Excessive or unacceptable sustained latency values often point out person expertise degradation earlier than reaching precise capability limits or precise useful resource (for instance, CPU or reminiscence) depletion |
Throttling | Capability limits | Milliseconds, bytes, or messages | Excessive or unacceptable sustained throttling values point out capability limits are being reached earlier than precise useful resource (for instance, CPU or reminiscence) depletion |
By monitoring these attributes, we will shortly consider the efficiency of the clusters as we add extra workloads to the platform. We then match these attributes to the related MSK metrics out there.
Cluster capability limits
Throughout the preliminary capability planning, our MSK clusters weren’t receiving sufficient site visitors to offer us with a transparent thought of their capability limits. To deal with this, we used the AWS efficiency testing framework for Apache Kafka to judge the theoretical efficiency limits. We performed efficiency and capability checks on the check MSK clusters that had the identical cluster configurations as our growth and manufacturing clusters. We obtained a extra complete understanding of the cluster’s efficiency by conducting these numerous check situations. The next determine exhibits an instance of a check cluster’s efficiency metrics.
To carry out the checks inside a particular time-frame and funds, we centered on the check situations that might effectively measure the cluster’s capability. As an illustration, we performed checks that concerned sending high-throughput site visitors to the cluster and creating subjects with many partitions.
After each check, we collected the metrics of the check cluster and extracted the utmost values of the important thing cluster utilization attributes. We then consolidated the outcomes and decided essentially the most acceptable limits of every attribute. The next screenshot exhibits an instance of the exported check cluster’s efficiency metrics.
![]() |
Capability monitoring dashboards
As a part of our platform administration course of, we conduct month-to-month operational critiques to take care of optimum efficiency. This includes analyzing an automatic operational report that covers all of the programs on the platform. Throughout the assessment, we consider the service degree aims (SLOs) based mostly on choose service degree indicators (SLIs) and assess the monitoring alerts triggered from the earlier month. By doing so, we will establish any points and take corrective actions.
To help us in conducting the operational critiques and to offer us with an outline of the cluster’s utilization, we developed a capability monitoring dashboard, as proven within the following screenshot, for every setting. We constructed the dashboard as infrastructure as code (IaC) utilizing the AWS Cloud Improvement Equipment (AWS CDK). The dashboard is generated and managed routinely as a element of the platform infrastructure, together with the MSK cluster.
By defining the utmost capability limits of the MSK cluster in a configuration file, the bounds are routinely loaded into the capability dashboard as annotations within the Amazon CloudWatch graph widgets. The capability limits annotations are clearly seen and supply us with a view of the cluster’s capability headroom based mostly on utilization.
We decided the capability limits for throughput, latency, and throttling by way of the efficiency testing. Capability limits of the opposite metrics, resembling CPU, disk area, and reminiscence, are based mostly on the Amazon MSK greatest practices pointers.
Throughout the operational critiques, we proactively assess the capability monitoring dashboards to find out if extra capability must be added to the cluster. This strategy permits us to establish and tackle potential efficiency points earlier than they’ve a big affect on person workloads. It’s a preventative measure moderately than a reactive response to a efficiency degradation.
Preemptive CloudWatch alarms
We’ve got applied preemptive CloudWatch alarms along with the capability monitoring dashboards. These alarms are configured to alert us earlier than a particular capability metric reaches its threshold, notifying us when the sustained worth reaches 80% of the capability restrict. This technique of monitoring allows us to take speedy motion as a substitute of ready for our month-to-month assessment cadence.
Worth added by our capability planning strategy
As operators of the Hydro platform, our strategy to capability planning has offered a constant solution to assess how far we’re from the theoretical capability limits of all our clusters, no matter their configuration. Our capability monitoring dashboards are a key observability instrument that we assessment frequently; they’re additionally helpful whereas troubleshooting efficiency points. They assist us shortly inform if capability constraints might be a possible root reason behind any ongoing points. Which means that we will use our present capability planning strategy and tooling each proactively or reactively, relying on the state of affairs and wish.
One other advantage of this strategy is that we calculate the theoretical most utilization values {that a} given cluster with a particular configuration can face up to from a separate cluster with out impacting any precise customers of the platform. We spin up short-lived MSK clusters by way of our AWS CDK based mostly automation and carry out capability checks on them. We do that very often to evaluate the affect, if any, that modifications made to the cluster’s configurations have on the recognized capability limits. In accordance with our present suggestions loop, if these newly calculated limits change from the beforehand recognized ones, they’re used to routinely replace our capability dashboards and alarms in CloudWatch.
Future evolution
Hydro is a platform that’s always enhancing with the introduction of recent options. One in every of these options consists of the flexibility to conveniently create Kafka consumer purposes. To satisfy the rising demand, it’s important to remain forward of capability planning. Though the strategy mentioned right here has served us effectively to date, it’s in no way the ultimate stage , and there are capabilities that we have to lengthen and areas we have to enhance on.
Multi-cluster structure
To help crucial workloads, we’re contemplating utilizing a multi-cluster structure utilizing Amazon MSK, which might additionally have an effect on our capability planning. Sooner or later, we plan to profile workloads based mostly on metadata, cross-check them with capability metrics, and place them within the acceptable MSK cluster. Along with the present provisioned MSK clusters, we are going to consider how the Amazon MSK Serverless cluster kind can complement our platform structure.
Utilization tendencies
We’ve got added CloudWatch anomaly detection graphs to our capability monitoring dashboards to trace any uncommon tendencies. Nonetheless, as a result of the CloudWatch anomaly detection algorithm solely evaluates as much as 2 weeks of metric knowledge, we are going to reassess its usefulness as we onboard extra workloads. Apart from figuring out utilization tendencies, we are going to discover choices to implement an algorithm with predictive capabilities to detect when MSK cluster sources degrade and deplete.
Conclusion
Preliminary capability planning lays a stable basis for future enhancements and offers a protected onboarding course of for workloads. To realize optimum efficiency of our platform, we should guarantee that our capability planning technique evolves in step with the platform’s development. Because of this, we preserve a detailed collaboration with AWS to repeatedly develop further options that meet our enterprise wants and are in sync with the Amazon MSK roadmap. This makes certain we keep forward of the curve and may ship the very best expertise to our customers.
We suggest all Amazon MSK customers not miss out on maximizing their cluster’s potential and to start out planning their capability. Implementing the methods listed on this publish is a superb first step and can result in smoother operations and vital financial savings in the long term.
In regards to the Authors
Eunice Aguilar is a Workers Information Engineer at REA. She has labored in software program engineering in numerous industries all through the years and not too long ago for property knowledge. She’s additionally an advocate for ladies serious about transitioning into tech, together with the well-versed who she takes inspiration from.
Francisco Rodera is a Workers Methods Engineer at REA. He has intensive expertise constructing and working large-scale distributed programs. His pursuits are automation, observability, and making use of SRE practices to business-critical companies and platforms.
Khizer Naeem is a Technical Account Supervisor at AWS. He makes a speciality of Environment friendly Compute and has a deep ardour for Linux and open-source applied sciences, which he leverages to assist enterprise prospects modernize and optimize their cloud workloads.