Adopting APIs has allowed organizations to create exceptional customer experiences that help businesses meet and exceed their goals. And as API use increases across diverse architectures and business priorities, IT teams need to ensure control and security for those APIs.
After all, customer trust is slow to build and quick to lose – and one data breach is all it takes to create a breach in trust. But IT teams must also ensure faster API access, as customers expect an immediate response when interacting with applications and websites. This means IT teams’ challenge is balancing security and control without sacrificing the application’s performance, and it all needs to be done without delay.
Best practices across all industries show that IT teams must select a lightweight and fast gateway to control and secure APIs. Anypoint Flex Gateway takes API management to the next level by empowering developers and architects with a lightweight and ultrafast gateway to control any API deployed anywhere. The distributed Flex Gateway is supported by a centralized control plane (Anypoint API Manager) to manage, configure, and analyze policies and API traffic.
MuleSoft Anypoint Flex Gateway allows IT teams to manage and secure APIs regardless of environment and architecture, which is an invaluable measure against the complications caused by API sprawl. The result is consistent policies across an organization’s digital estate, creating a unified and more secure network.
We’ll discuss how Anypoint Flex Gateway provides an ultrafast and lightweight gateway with the results from performance benchmark tests. The results presented in this blog focus on standard and sidecar deployments in Kubernetes, where the load generator is within the cluster to minimize the effects of external factors such as a load balancer. Please note that the performance of Flex Gateway in an ingress-controller deployment will have similar results to the standard deployment.
To find additional Flex Gateway benchmarking numbers and the methodology used, take a look at the upcoming Anypoint Flex Gateway Benchmarking Guide launching December 2022.
HTTP GET requests
Here, we will cover HTTP GET requests only with the effect of response payload size on query per second (QPS) & latency and CPU and memory usage.
GET requests: Effect of payload on QPS & latency
Figure 1 below shows no significant difference between standard and sidecar deployment. Average latency increases with an increase in the response payload size, with the most important difference between 10 KB and 100 KB. However, consistency between 1KB and 10 KB response payloads indicates that Flex Gateway can process at optimal throughput between these two sizes.
With consistent throughput and low latency, users can expect quicker API responses through their applications. The latency at higher payloads can also be mitigated with HTTP caching enabled. This means that latency for a 100KB response would only apply to requests with no cached responses. For developers, the high throughput and low latency with out-of-the-box Flex Gateway configuration mean saving time on the performance tuning to spend more time on the API development itself.
Latency distribution was also calculated, and detailed charts are provided in the upcoming Anypoint Flex Gateway Benchmarking Guide. As a sneak preview, here are the numbers we got as latency distribution for both deployments at 1KB response payload. The low latency distribution means faster page loads for high-performance web applications, resulting in a better experience for the end user.
|Latency Distribution %||Standard Deployment Latency (ms)||Sidecar Deployment Latency (ms)|
GET requests: CPU and memory utilization
Figure 2 below shows CPU and memory utilization for GET requests. There is a negligible difference in Memory utilization between payload sizes, indicating that Flex Gateway can scale to process queries without taxing the memory resources.
On average, sidecar deployment has 30–40% lower utilization for memory than standard deployment. This is because Flex Gateway is in the same Kubernetes pod. In addition, the average CPU usage for the sidecar is almost close to 0 cores, indicating that Flex Gateway is highly performant when placed directly next to the backend server or the microservice. This allows organizations to manage and secure APIs with Flex Gateway without creating additional endpoints.
The resource utilization will determine the sizing and costs needed to run Flex Gateway at optimal performance. Sidecar deployment for Flex Gateway is the best option for productions requiring a faster response with minimal resource usage.
Standard deployment should be utilized when APIs are scattered throughout multiple nodes or pods, and one gateway is needed to manage all of them. Dedicated resources for the gateway could also be fine-tuned with the standard deployment to maximize cost savings.
IT teams are more resource-strapped than ever, and IT leaders are facing the call to deliver more projects while their budgets continue to shrink. With Flex Gateway, organizations can provide a seamless user experience while keeping their applications lean, ultimately allowing for better outcomes.
The benchmarking numbers show that the gateway has high throughput and a small resource footprint. Flex Gateway performs well under higher traffic and makes it easy for developers to set up and implement automatically with CI/CD pipeline as the services are put into production. This results in developers saving time when setting up the gateway and ensures that the APIs are still managed and secured.
Benefits of Anypoint Flex Gateway:
- High performance
- Low CPU usage and memory needs
- Small footprint and high throughput
It’s time to enable your team with an API gateway solution that allows developers to focus on building innovations while making it easier for the organization to meet business goals by accessing the data they need securely and fast. With MuleSoft Anypoint Flex Gateway your organization can achieve success quickly and make an impact on your customer experiences now.
If you’d like to learn more about Anypoint Flex Gateway’s benchmarking numbers and methodology, read more in the upcoming Anypoint Flex Gateway Benchmarking Guide. This whitepaper focuses on Local Mode only for performance to minimize the number of dependencies in the testing.
Disclaimer: The MuleSoft Performance Engineering team collected the numbers presented in this report. The metrics were collected in a controlled environment and should not be explicitly used to size deployments.
Flex Gateway performance will vary based on:
- Type of deployments such as containers, VM, or bare metal
- Number of CPU Cores
- Number of applied policies
- Size of response payload
- Backend service response time
Before using Flex Gateway in production; organizations should run tests based on their criteria to consider the trade-offs. If you need help with Flex Gateway sizing, we recommend getting in touch with a MuleSoft representative.
- Melchor Brondo Gutierrez
- Anubhav Kumar Tyagi
- Shruti Buch
- Ryan Yeager