The promise of Kubernetes lies in seamless scalability, yet running high-performance Node.js applications often reveals “invisible” friction. While JVM tuning has a long history of optimization, many Node.js deployments still rely on V8 defaults originally designed for the browser, not the high-density environment of containerized microservices.
Akamas Insights now optimizes the Node.js (V8) runtime on Kubernetes. It tunes V8 memory flags and pod CPU limits together, so applications stop hitting CPU throttling and out-of-memory kills. In production benchmarks, this cut CPU overhead by 68% with no code changes.
Even for the JVM, which is often considered “solved”, achieving peak efficiency remains a moving target. As wepreviously explored in our JVM performance studies, there is still significant room for optimization in modern cloud-native environments. At Akamas, we believe efficiency should be automated, not a manual burden. By bridging the gap between Kubernetes orchestration and V8’s internal mechanics, Akamas Insights lets SREs and Platform Engineers move beyond basic “right-sizing” and achieve true full-stack harmony.
The Hidden Bottleneck: The V8 Configuration Gap
Node.js is built on V8, Google’s high-performance JavaScript engine. While V8’s generational garbage collector is a marvel of engineering, its default heuristics often clash with the rigid boundaries of a Kubernetes pod.
In many cases, the runtime is unaware of the tight memory constraints of a container, leading to a “reliability trap”. If the V8 heap is sized too aggressively, the container hits a hard limit and suffers an Out-Of-Memory (OOM) kill. If it is sized too conservatively, the engine triggers excessive Garbage Collection (GC) cycles. Those cycles steal CPU from the application, and once the container exceeds its CPU limit, Kubernetes throttles it. The result is added latency at exactly the wrong moment.
The impact of these suboptimal defaults is most visible during Horizontal Pod Autoscaling (HPA) events. In high-demand scenarios Node.js applications often struggle with “warm-up” friction. As the HPA triggers new pods to handle a spike, the V8 engine’s initial optimization and memory allocation phases can cause a lag in responsiveness, exactly when the system needs to be at its fastest.
The potential for improvement is significant. By moving beyond generic defaults and tuning V8 specifically for the container’s resource profile, we have demonstrated response time reductions of up to 35% for major enterprise applications (Akamas Insights production benchmarks, 2026). This isn’t just about “tuning”; it’s about reclaiming wasted resources and ensuring the runtime and the orchestrator work in tandem.
The Akamas Way: Vertical Full-Stack Optimization
Traditional optimization tools look at the world through a single lens, either the infrastructure or the application. Akamas Insights takes a vertical approach. A Node.js application is a layered stack, and every level affects the next.
True efficiency requires coordinating three critical layers:
The V8 runtime: tuning parameters like --max-semi-space-size and --max-old-space-size to minimize GC pressure and maximize execution speed.
The Kubernetes pod: aligning CPU and memory requests and limits to the actual footprint of the optimized runtime, preventing throttles and OOM events.
The Horizontal Pod Autoscaler (HPA): synchronizing scaling logic with the new resource boundaries to prevent “flapping” and instability.
The impact of this data-driven approach is significant. In recent production benchmarks, we applied Akamas Insights to enterprise-grade Node.js workloads. By moving away from V8 defaults and identifying the optimal configuration for heap generation sizing, we achieved a 45% increase in application throughput and a 68% reduction in CPU overhead (Akamas Insights production benchmarks, 2026).
These gains do not require a single line of code change. They are the result of data-driven tuning that calibrates the engine for its environment. When the runtime is healthy, the application uses fewer resources to do more work. That translates directly to lower cloud costs and higher service reliability.
Engineering the Michelin Standard
The addition of Node.js support to Akamas Insights marks a shift toward a more sophisticated era of optimization. We are moving away from the “one-size-fits-all” approach to infrastructure and toward a culture of precision and real full-stack optimization.
With Akamas, your SRE and FinOps teams no longer have to choose between performance and cost. By providing visibility into the “black box” of the V8 engine and automating the discovery of optimal configurations, we empower your developers to deliver a flawless user experience alongside a well-managed budget. Eliminate the performance overhead of default V8 settings and ensure predictable autoscaling.Start your free trial of Akamas to achieve full-stack harmony between Node.js and Kubernetes.
FAQs
What is CPU throttling in Kubernetes?
CPU throttling happens when a container exceeds its CPU limit. Kubernetes then restricts the container’s CPU time, which adds latency. For Node.js, excessive V8 garbage collection is a common trigger, because GC cycles consume CPU the application needs.
How do you stop Node.js CPU throttling on Kubernetes?
Tune the V8 heap so garbage collection runs less often, then align pod CPU requests and limits to the optimized runtime. Akamas Insights tunes both layers together. In production benchmarks, this cut CPU overhead by 68% with no code changes.
Which V8 flags matter for Node.js in containers?
The two most important flags are --max-old-space-size and --max-semi-space-size. They control heap sizing and how often V8 runs garbage collection. Setting them for the container’s memory profile prevents both OOM kills and excessive GC.
How do you prevent Node.js from getting OOMKilled on Kubernetes?
Size the V8 heap below the pod memory limit, not above it. If --max-old-space-size exceeds the container limit, the pod hits a hard boundary and Kubernetes kills it. Akamas aligns heap size with pod limits automatically.
Does tuning V8 for Kubernetes require code changes?
No. The gains come from configuration, not code. Akamas Insights identifies the optimal V8 flags and pod resource settings from observed workload behavior, so developers ship no changes.
If you are a cloud native company, you already know that Kubernetes is a solid choice for deploying and managing modern applications at scale. It’s flexible, powerful, and capable of handling complex workloads. However, there is also the potential for serious performance headaches.
Many people think performance optimization is just about cutting costs or squeezing efficiency out of resources. That’s part of it, but not all of it. It’s also about delivering reliable services without over-provisioning. There is a fine line between balancing performance, reliability, and costs. Nobody wants a cheap Kubernetes environment if it’s always down (or slow). That only frustrates users. Nobody wants a robust Kubernetes environment that costs so much to run that it defeats the purpose.
Kubernetes optimization is more than tuning the cluster (sorry, platform engineers). It’s a holistic effort that involves many layers, including the cluster, the workloads and application runtimes like the JVM running on it. Focusing on just one piece leaves significant optimization opportunities on the table. It’s a layered stack: the infrastructure (nodes, networking, storage), the control plane (scheduling, autoscaling), and the applications themselves. Each layer needs attention.
In this article, we’re going to look at the top performance pitfalls that we see on a regular basis from customers in their Kubernetes journey. We’ll show you how to avoid these antipatterns and share practical tips to keep your deployments smooth.
1. Settings CPU Limits Based on Theory Rather Than Experience
By far, pod resource requests and limits are the biggest challenge K8s teams face. If you’re not familiar, we described how requests and limits work and their impact on costs and reliability in a previous post.
One of the most debated aspects is CPU limits: is it best to set them for your workloads, or avoid them and just live with CPU requests? CPU limits can cause CPU throttling and significant application performance degradation, such as response-time slowdowns, even when CPU usage is low compared to the limit.
But CPU limits can also be critical for cluster stability and application performance in shared or multi-tenant clusters. So, as a developer or operator of K8s apps aiming for reliability and efficiency, what should you do?
To understand how CPU limits actually work, we ran performance tests under CPU-contention scenarios. We measured application performance when a misbehaving job, co-located on the same node, saturates the node CPUs. We tested two setups: CPU requests only (no limits), and both requests and limits set.
The result? CPU requests alone do not protect latency-sensitive workloads from a noisy neighbor. In our tests, application p95 latency rose 3x. With CPU limits in place, the CPU-hungry job could no longer saturate the node, and the impact on application performance was contained.
Why is that? This might sound counterintuitive, especially as many people expect CPU requests to prevent such situations. But there is nothing wrong here: that’s exactly how CPU resource management works on K8s (courtesy of Linux cgroups), and failing to understand it can have serious consequences for app performance and stability, as others have noted too. More details in an upcoming blog.
2. Picking the Wrong Instance types for your Nodes
Kubernetes provides built-in autoscalers at the cluster level, adding nodes when demand rises and removing them when traffic dies down. The Cluster Autoscaler (or Karpenter) watches resource requests from pending pods, spins up new nodes to accommodate them, then scales down during quiet periods to save costs.
A common issue SREs and platform engineers face is failing to keep node-group configuration matched to workload resource requirements. Teams often configure node groups with standard cloud instance types and never revisit whether the CPU-to-memory (or GPU) ratio matches the workload shape.
This can produce highly inefficient allocation at the cluster level, with significant CPU or memory (and cost) wasted. What often happens: the cluster autoscaler adds nodes for pending pods, but only one resource (say, memory) is exhausted while the other (say, CPU) sits idle and wasted.
Let’s look at an example. In this cluster, the cluster autoscaler creates nodes due to a memory shortage (right chart). In doing so it provisioned roughly 5,000 CPUs that went unused, because the workloads never requested them (left chart).
Notice that the cluster autoscaler works perfectly here. Nevertheless, a huge amount of resources and cost is wasted because of the poor instance-type configuration in the underlying node groups.
Choosing node types and scaling your cluster is like picking the right rental car for a road trip. Too small, and everyone is cramped, with no room for luggage. Too big, and you burn far too much fuel, and every gas-station stop leaves your wallet in shock. Misjudge your node instance types, or fail to scale dynamically, and you’ll either hit bottlenecks or waste a lot of resources.
3. JVM Misconfigurations for Java Applications
Java applications on Kubernetes can be particularly tricky. The Java Virtual Machine (JVM) is a highly configurable engine with 500+ options that can be tuned for performance and resource efficiency. But JVM tuning requires deep expertise and is notoriously hard. Even a common task like determining the optimal heap memory size can be surprisingly complex for Java developers.
Containers and Kubernetes add another layer of complexity: how should you configure the memory limit and heap size of your JVM? And what about CPU limits and garbage-collector type? For high-performance, reliable, efficient Java apps, JVM resource management must be aligned with Kubernetes pod resource settings. Despite the JVM’s container-aware heuristics, in practice the default configurations are wasteful, prone to reliability issues, or cause unnecessary slowdowns.
Here’s a real example. In the chart below you can see an out-of-memory kill (OOMKill) that hit application availability. Seeing the steady rise in container memory usage, the SRE team blamed a memory leak in the application – time to fix your code, dear development team! But there was no memory leak. The real cause was a JVM misconfiguration: the pod memory limit did not account for total JVM memory demand, which includes both heap and off-heap memory.
4. Poor application performance due to wrong JVM heap sizing
In the previous pitfall we covered jointly optimizing pod resources and the application runtime to avoid reliability issues. But a wrong JVM configuration can hurt application performance too.
Many developers assume the JVM performs best out of the box, especially with container-awareness features that let it size the heap automatically from pod memory limits. In reality – whether you set the heap explicitly (e.g. via -Xmx) or rely on container awareness (e.g. MaxRAMPercentage) – the resulting heap size may be well off and slow your application substantially.
To show this, we ran benchmarks with the DaCapo Java suite, which mimics real-world Java workloads. We used the G1 garbage collector on Java 21 (eclipse-temurin) and measured Spring Boot latency across different JVM max-heap sizes. Here’s what we found:
If the heap is too small, performance suffers badly. A 20% latency impact is easy to hit, rising to 65% when the heap is too tight.
Beyond a certain size, more heap doesn’t help. Throwing gigabytes of memory at a Java app is not useful – the extra memory is basically wasted.
As a Java developer looking to optimize your applications and microservices, don’t forget to size your JVM heap properly.
5. Resource Management for Node.js Applications
Node.js applications often hit performance and reliability issues on Kubernetes because of their unique (and, honestly, under-documented) runtime characteristics.
Node.js runs on a managed runtime called V8, which resembles the JVM in many ways, including automatic memory management via garbage collection and a multi-threaded architecture (yes – the Node.js runtime is not single-threaded).
A common problem is an out-of-memory kill (OOMKill). This mirrors pitfall #3 for the JVM: most teams misread OOMKills as a memory leak, when the real issue is how heap memory is sized relative to container memory limits.
Less known is that Node.js performance and resource usage are also very sensitive to V8 garbage collection and heap settings. In an earlier blog we benchmarked a Node.js app across different V8 heap-pool sizes. Tuning the V8 heap memory pools cut application latency by nearly 50%, with no code changes. Similar gains showed up on CPU usage – which means savings on infrastructure footprint and cost.
Kubernetes provides built-in application-level scaling via the Horizontal Pod Autoscaler (HPA), adding pods when demand rises and removing them when traffic dies down. HPA can be a lifesaver, but it’s not a set-and-forget solution.
HPA needs careful tuning of scaling metrics, thresholds, and periods. Scaling behaviour is highly application- and traffic-dependent. Is your app’s startup time quick or slow? Do you need to react to sudden traffic peaks, or does traffic build slowly? Depending on your performance requirements or SLOs, HPA must be configured accordingly.
Teams often don’t get HPA right, and we regularly see deployments that scale too slowly, too aggressively, or fail to scale down. A poorly tuned HPA will:
hurt end-user performance
cause unnecessary SLO breaches and production incidents
waste a lot of resources
push the cluster autoscaler to provision unnecessary nodes
Look at this example. The team rightly adopted HPA for a deployment with fluctuating traffic, but set the scaling threshold far too low. As a result, HPA scaled the deployment far too much: overall HPA scaling efficiency (CPU used / CPU requested) was just 9%, wasting most of the requested CPU.
The lesson: as with cluster-level autoscaling, simply adding HPA to your workloads may not meet the scalability and efficiency goals you’re after.
7. VPA Missteps with Requests and Limits
The Vertical Pod Autoscaler (VPA) is often the most recommended tool for setting pod resource requests and limits. VPA automatically sets container requests and limits based on observed usage.
That sounds like exactly what’s needed, but the reality is different.VPA has a number of known limitations that many teams are not aware of, and can make it inapplicable in real-world production environments.
There is one very important limitation not even mentioned in the docs. The VPA recommendation algorithm takes a purely infrastructure-only approach: it looks at resource usage and adjusts resources, with no awareness of the application running inside the pod.
Why is that a problem? Modern apps run on a runtime that manages resources such as heap memory and CPU threads. Runtimes like the JVM or Node.js V8 adjust automatically based on pod resource limits. The VPA is unaware of how these runtimes behave, so applying its recommendations without care can create performance and reliability issues.
Infrastructure-only approaches like the VPA can also slow your application down. In one customer test, the team applied VPA recommendations to a Java app and measured response time before and after. The change introduced significant slowdowns, making the app unresponsive to users.
Why did that happen? Read this blog on why it’s crucial to consider the application runtimes inside containers and why infrastructure-level metrics aren’t enough. This holds for any tool or approach that looks only at container-level resource metrics – not just the VPA.
8. Pod Sizing for Disaster Recovery (DR) and High Availability (HA)
Poorly sized pods in disaster-recovery or high-availability scenarios can jeopardize cluster resilience. If pods aren’t configured to handle failover or spikes, you risk downtime or degraded performance during critical moments.
This is a common challenge for SREs and development teams working out the best resource-allocation strategy. Teams typically size pods against currently observed load. For example, a pod requests 4 CPUs but uses just 1, so you downsize it to match the 1-CPU demand and save cost.
The problem: this ignores reliability, high availability, and business-continuity requirements. Your applications may need to withstand the failure of one or more data centers and keep response times good during infrastructure disruptions.
Properly sizing workloads for degraded scenarios means simulating the impact of 2x traffic on your workloads. And again, it’s not only about pod resources: your application runtime – like the JVM heap memory – must be considered too, to avoid unexpected bottlenecks at critical moments.
9. Configuration Chaos and Drift
Technical issues aren’t the only challenges teams face adopting Kubernetes. A more organizational or process issue we see, especially in mid-to-large organizations, is that developers push frequent changes to production, and these can introduce performance regressions or outright break things across the cluster.
Part of the problem is that developers aren’t necessarily well-versed in the Kubernetes stack – and rightly so. As we showed in this blog, configuring apps and clusters for efficiency and performance is no small feat. Developers’ goal is usually to ship features quickly, not to become infrastructure experts.
Meanwhile, SREs and platform engineers have to cope with the fallout. Poor configuration of even a single workload can impact other applications on the same node (as shown in pitfall #1 on CPU limits) or the entire cluster (for example, if a node crashes).
Kubernetes is a great platform, but every user has to be a good citizen and use it wisely so everyone else can too. At scale, proper performance isolation and reliability practices are key – and in practice this doesn’t always happen. The only way to keep the platform stable, performant, and efficient is to adopt proper processes and tools that automate the optimization work as you scale.
10. Organizational Knowledge Gaps and Prioritization Conflicts
Kubernetes thrives on collaboration, but when priorities aren’t aligned between platform engineering and application teams, it creates a deadlock that affects both performance and reliability. When application teams lack Kubernetes expertise and prioritize feature speed over stability, big problems follow.
It typically goes like this:
Platform engineers understand Kubernetes intricacies, but application teams may lack the training to optimize their deployments. This leads to misconfigured resources or ignored best practices.
Application teams focus on shipping features quickly, sidelining critical tasks like performance tuning, monitoring setup, or adopting Kubernetes-native practices.
Without good collaboration, platform teams may enforce overly restrictive policies while application teams deploy suboptimal workloads. The result is friction between teams and unreliable software.
To fix this, invest in cross-team training to bridge the Kubernetes knowledge gap. Offer workshops or hands-on learning tailored to application teams. Establish clear service-level objectives (SLOs) that align platform and application priorities, balancing feature velocity with reliability goals.
Tools to Save the Day
Here are some tools and techniques to help you tune Kubernetes for better performance:
Observability: Use tools like Prometheus, OpenTelemetry, or commercial options like Dynatrace and Datadog to understand resource usage. Don’t stop at workload-level metrics – collect application-runtime metrics too, as they are critical for success, as shown throughout this post.
AI-powered tuning: Use tools that automate full-stack Kubernetes optimization to reduce the effort and skills required from engineering teams. Akamas autonomously optimizes the full-stack configuration of enterprise applications – from infrastructure to application layers – using reinforcement learning, live telemetry, and user-defined goals, both live in production and offline in testing.
Load testing: Simulate traffic with tools like Locust, JMeter, or commercial options like OpenText LoadRunner and Tricentis NeoLoad. Load testing is often the best way to find scalability bottlenecks and tune workload configurations like the JVM or HPA before you deploy to production.
Chaos engineering: Use tools like Chaos Toolkit, Chaos Mesh, or commercial options like Gremlin to test resilience against worst-case events. This helps confirm applications can sustain traffic in disaster-recovery scenarios.
Advanced Kubernetes features: Use capabilities like taints, tolerations, affinity rules, priority classes, resource quotas, and HPAs to build reliable, efficient clusters.
Wrapping It Up
Kubernetes is a great platform to scale your cloud applications on, and we love it – but performance and efficiency won’t come for free. You can build clusters that are fast, reliable, and cost-effective by avoiding these common pitfalls. The key is to stay proactive: monitor relentlessly, tune continuously, and build a performance-engineering culture where everyone cares about performance within their own scope.
If you’re struggling with Kubernetes performance, we can help. Explore Akamas Insights to see how our AI-driven optimization platform tackles all of these challenges and cuts cost. We understand the problems companies face deploying Kubernetes at scale, and we can help you too.
FAQs
What causes poor performance in Kubernetes?
Most Kubernetes performance problems come from small misconfigurations across three layers: infrastructure (node instance types), the control plane (HPA, VPA, cluster autoscaler), and the application runtime (JVM or Node.js/V8). Optimizing one layer while ignoring the others leaves gains on the table and can even create new bottlenecks.
Do CPU limits help or hurt Kubernetes performance?
Both, depending on context. CPU limits can cause throttling and slow a workload even when usage looks low. But in shared or multi-tenant clusters they protect latency-sensitive workloads from noisy neighbors. In Akamas contention tests, removing CPU limits let a misbehaving job push p95 latency 3x higher.
Why do Java applications get OOMKilled on Kubernetes?
Usually not because of a memory leak. The common cause is a pod memory limit that doesn’t account for total JVM memory demand, which includes both heap and off-heap memory. When off-heap usage is ignored, container memory grows past the limit and Kubernetes issues an OOMKill.
Does the Vertical Pod Autoscaler (VPA) improve application performance?
Not reliably. The VPA sets requests and limits from observed infrastructure usage alone, with no awareness of the runtime inside the pod. Because runtimes like the JVM and V8 react to pod limits, applying VPA recommendations blindly can slow an application down, as seen in a customer test on a Java app.
How do you optimize Kubernetes performance across the full stack?
Tune pods, application runtimes, and nodes together instead of in isolation. Align JVM or V8 settings with pod resource limits, size node instances to workload shape, and validate autoscaling under realistic traffic. Automating this full-stack tuning – for example with Akamas – reduces manual effort and keeps configurations optimal as workloads change.
In 2025, Kubernetes dominates the cloud container landscape. It is the “operating system of the cloud.” Yet many organizations are discovering how expensive it is to run and scale. OOM kills anyone?
Application performance optimization on Kubernetes usually stops at pod requests and limits. That misses the layer where most waste and most reliability risk actually live: the application runtime. Tuning the JVM, Node.js V8, .NET CLR, or Go runtime alongside pod and node settings is what turns Kubernetes cost and reliability around.
Overprovisioning to avoid an outage costs companies far more than they budgeted when they first migrated to containers. Many teams right-size pods and tune cluster resources to fix it. Most still miss the fundamental layer that holds the key to poor reliability and overspending: the language runtime of the application itself. As a result, they leave money on the table and suffer avoidable reliability incidents.
Modern applications do not run directly on Kubernetes. They execute on language runtimes like the Java Virtual Machine, the Node.js V8 engine, the .NET CLR, or the Go runtime. None of these is “tuned” out of the gate. Each exposes an intimidating number of options for memory allocation, garbage collection, thread management, and compilation. Each setting can make a large difference in performance and resource use. This area gets ignored because the platform teams that deploy the applications focus on Kubernetes, not on the applications themselves.
Java 21 has an outstanding 537 configuration options. How many are you actually setting?
The Hidden Costs of Pod-Only Kubernetes Optimization
The main approach SREs and platform teams use today is tuning pod requests and limits. That instinct is right, because applications are where most of the waste comes from. The execution is misguided. It looks only at Kubernetes metrics like pod-level CPU and memory. What happens inside the application is treated as someone else’s problem.
Tuning at that level is genuinely hard. The right configuration is specific per application and demands a granular view. Focusing on infrastructure alone produces three problems we see as a pattern at Akamas.
Memory Misconfiguration Leads to Cascading Failures
Consider a typical Java application in a Kubernetes pod. Infrastructure monitoring shows the pod steadily uses 2GB, so a tool recommends cutting the limit from 4GB to 2.5GB for savings. That recommendation ignores the JVM heap configuration, which may be set to use up to 3GB based on the original 4GB limit.
The result? A slight traffic increase pushes the JVM to use all the allocated heap, and Kubernetes kills the pod. These reliability problems are invisible in infrastructure metrics until it is too late.
Auto-Configuration Creates Performance Cliffs
Java’s runtime reacts to your pod resources. Reduce a pod’s allocation and the runtime adjusts its own parameters. The JVM shrinks the heap, changes garbage collection behavior, and modifies thread pool sizes.
These automatic adjustments often create problems. A slightly smaller memory limit can shrink the JVM heap. That triggers far more frequent garbage collection, which burns CPU and raises latency. The Node.js V8 engine behaves the same way. Memory pressure there can cause dramatic swings in resource use and execution performance.
Efficiency Gains Require Runtime Tuning
Right-sizing infrastructure removes some waste. It does not make the application more efficient. True efficiency comes from optimizing how the runtime uses resources. Developers routinely set Java heap far higher than the application needs. Properly sizing the heap can cut the memory footprint in half, with the same performance. Different garbage collection algorithms in the JVM can vary CPU usage by 30% for identical workloads. The default V8 settings are tuned for browsers, not for the high-throughput server workloads that Node.js runs.
Tune the runtime parameters and you often get the same performance with far fewer resources. You can also get more performance from the same allocation. Sometimes the result shows up as a welcome drop on the monthly cloud invoice. This level of optimization is impossible without understanding the application layer.
How Runtime Config Breaks Kubernetes Autoscaling
Optimization gets harder once Kubernetes autoscaling enters the picture. Horizontal Pod Autoscaling acts on the metrics and thresholds you define. If the runtime is poorly configured and out of step with pod requests and limits, these systems scale wrong. You get an excessive pod count that triggers unnecessary cluster scale-out, or under-provisioning that degrades performance.
There’s more to Kubernetes scaling than meets the eye.
Node selection is another challenge. Should the workload run on compute-optimized instances with a high CPU-to-memory ratio, or memory-optimized instances with more RAM per core? The answer depends on the workload’s resource shape, which is driven mainly by the runtime configuration. Kubernetes cluster autoscalers can match provisioned resources to requests. Turning one on is not enough on its own. Your node group configuration is what makes node shapes match your workloads.
Multiply these decisions across hundreds of microservices, each with different runtime needs and resource patterns. Manual optimization is not practical at that scale. When automated tools ignore the application layer, that blind spot guarantees overspending and reliability incidents.
Application performance optimization requires analyzing application metrics alongside infrastructure utilization. That means response times, throughput, error rates, garbage collection frequency, and more. You need the application-layer context that infrastructure metrics alone cannot give you.
This is why application-aware optimization is essential to any sound Kubernetes optimization strategy. It also enables real collaboration between platform engineering, SREs, and developers, which produces more efficient and more reliable applications.
An optimization tool that sees both layers at once shows you what you have been missing. A pod can show low CPU at the infrastructure level while suffering high garbage collection overhead that consumes CPU cycles inefficiently. A traditional tool recommends cutting CPU. An application-aware tool fixes the garbage collection stress instead.
The payoff is that you improve cost efficiency and application performance together. You stop choosing between saving money and holding performance. You get both.
The Path Forward: Full-Stack Performance and Cost Gains
Organizations that use Akamas consistently report significant improvements, sometimes dramatic ones. In Akamas customer engagements, cost reductions of 20-50% are common when application tuning is combined with infrastructure optimization. Misconfigurations that cause reliability issues get identified and fixed fast. Performance gains often exceed the cost savings, with response-time reductions of 30% that are not uncommon. Akamas often pays for itself in the early stages of tuning.
Instead of fighting resource constraints and performance issues, teams can proactively tune their specific Kubernetes environment for their own applications. Teams that adopt application-aware optimization end up with more efficient, more reliable, and more cost-effective Kubernetes deployments.
What is application performance optimization on Kubernetes?
It is tuning the application runtime, the pod settings, and the cloud nodes together, not in isolation. Most teams tune only pods. This approach also tunes the JVM, V8, or .NET CLR the application runs on, which is where much of the waste and reliability risk lives.
Why is pod rightsizing not enough to reduce Kubernetes cost?
Pod rightsizing looks at pod-level CPU and memory, not at what happens inside the runtime. A pod can look efficient while the JVM wastes CPU on garbage collection. Rightsizing alone can also shrink the heap and trigger OOM kills. Runtime tuning is what removes the underlying waste.
What happens to the JVM when you lower a pod’s memory limit?
The JVM reacts to the resources it sees. A smaller limit shrinks the heap, which can trigger far more frequent garbage collection, higher CPU use, and increased latency. Below a threshold, the pod gets OOMKilled. This is why heap settings must be tuned together with pod limits.
How much can runtime tuning reduce Kubernetes cost?
In Akamas customer engagements, combining application tuning with infrastructure optimization commonly cuts cost 20-50%. Properly sizing the JVM heap alone can halve the memory footprint at equal performance, and choosing the right garbage collector can shift CPU usage by around 30% for the same workload.
Which application runtimes can be optimized this way?
The same approach applies to the Java Virtual Machine, the Node.js V8 engine, the .NET CLR, and the Go runtime. Each exposes many options for memory, garbage collection, threading, and compilation. Java 21 alone has 537 configuration options.
Kubernetes optimization is easier said than done. The reality we keep finding in the wild is that clusters are massively over-provisioned, with average CPU usage at 5% or less. Those same applications still carry real reliability risk, and some are already having incidents. Over-provisioned and fragile at the same time.
Akamas Insights closes that gap. Insights analyzes your whole Kubernetes environment. It detects optimization opportunities across clusters, pods and application runtimes. It estimates the savings behind each one. It then recommends configuration changes you can apply safely, covering pod resources, HPA scaling policies, and runtime settings for the JVM and Node.js. Insights runs agentless, on metrics your monitoring stack already collects.
We built Akamas Insights for developers, SREs, DevOps and FinOps teams who need optimization results without becoming full-time optimization specialists.
Why Kubernetes optimization stalls
The promise of self-healing, efficient cloud-native applications is still not realized. After years of working with Kubernetes teams, we see two root causes. One is technical: Kubernetes resource management is genuinely hard. The other is organizational: the teams who could act on optimization are not the teams who own it.
The technical problem: pod resources, autoscaling and runtimes
Kubernetes resource management is difficult to reason about. How do you set pod requests, limits and horizontal scaling so that hundreds of microservices stay both reliable and efficient? Nobody does that by hand at scale.
Application runtimes make it harder. The JVM and Node.js V8 both size their memory from what the container exposes, not from what the application actually needs. The results are familiar: OOMKilled pods, CPU throttling, heap far larger than the workload uses, and slowdowns nobody can explain. We collected the ones we hit most often in 10 Kubernetes performance pitfalls.
The organizational problem: everyone owns a piece, nobody owns the outcome
Even when the technical answer is known, optimization work stalls. The reason is structural:
Platform teams run the clusters, but they cannot change application configuration.
Development teams own the applications, and they are measured on shipping features.
DevOps and SRE teams get handed optimization on top of automation work and incident response.
Performance engineers have the expertise, but they struggle to get time from teams with no test environment and competing priorities.
Everyone owns a piece of the problem. Nobody owns the outcome. There must be a better way.
What Akamas Insights does
Akamas Insights analyzes your entire Kubernetes environment and produces three things:
Visibility. Every optimization opportunity across all your clusters, in one place.
Impact. The estimated effect of each opportunity, including achievable savings.
Recommendations. Prioritized, safe configuration changes for both infrastructure and applications.
Setup requires no skills and no agents. Insights reads the metrics your Kubernetes observability tools already collect, so nothing new runs inside your workloads.
Automatic detection of Kubernetes optimization opportunities
Insights sorts what it finds into three categories. The point of splitting them is that different teams act on different categories.
Category
What Insights looks for
Example finding
Efficiency
Ways to cut resource usage and cost
Inefficient cluster autoscaling; heap memory far larger than the application uses
Reliability
Risks that can cause a production incident
JVM heap misaligned with the pod memory limit; HPA settings that cannot absorb a traffic peak
Compliance
Workloads that break your own best practices
Memory limits not equal to memory requests; JVMs running on default or inadequate options
Efficiency opportunities are where the cost savings sit. Insights looks at three layers to find them: clusters, workload pods, and application runtimes such as the JVM and Node.js V8. Analyzing all three together is what surfaces the bigger wins, including inefficient cluster autoscaling and memory wasted on over-provisioned heap.
Reliability matters more than cost to most SRE and development teams, so Insights detects reliability risks before they reach production. A workload whose JVM heap does not fit inside its memory limit is one example. Misconfigured HPA settings that stop an application absorbing traffic peaks are another.
Platform engineers get a third angle: preconfigured best-practice checks. Examples include memory limits that differ from memory requests, and JVMs still running on defaults.
Insights ships with 50+ preconfigured optimization opportunities across the full Kubernetes stack. We curated them from optimizing 1000s of Kubernetes clusters. (Source: Akamas field data from customer and prospect Kubernetes environments.) That is well beyond the scope of tools that look at pod resources alone.
Akamas Insights: optimization opportunities across clusters, pods and application runtimes.
Estimated savings across infrastructure and application workloads
An opportunity nobody can quantify does not get prioritized. So Insights estimates the impact of every opportunity it detects, and it ships that estimate with the finding rather than after it.
Insights estimates the resource footprint and the achievable savings, then splits the estimate two ways: infrastructure and application workloads. You can see the value of optimizing the workloads, the clusters, or both. In an organization where every team is already oversubscribed, showing an engineer the concrete benefit is what turns an optimization backlog into optimization work.
Application-aware recommendations you can apply safely
When we talk to Kubernetes teams, one theme comes up repeatedly: engineers are reluctant to optimize their applications. That is When we talk to Kubernetes teams, one theme comes up repeatedly: engineers are reluctant to optimize their applications. That is not stubbornness. They are the ones paged when reliability or performance breaks.
Most Kubernetes resource optimization tools do nothing about that fear, because they only consider the container and ignore the application running inside it. Applications do not run on Kubernetes directly; they run on a language runtime that most tools never look at. Insights recommends changes across the full application stack:
The difference is not academic. At Sisal the money was in the JVM, not in the container. Oversized JVM memory was the largest single source of waste. Correcting it cut the cost of critical microservices by 58%. A tool that stops at the container boundary cannot see that. The same argument applies to Node.js. In our own benchmarks, tuning the V8 heap pools cut application latency by almost 50%, with no code changes.
What this looks like in production
Sisal, a gaming operator serving 35 million customers, cut the cost of critical Kubernetes microservices by 58%. It took two weeks of live optimization, and the biggest lever was oversized JVM memory rather than container sizing. Akamas tuned pod sizing, JVM heap and the garbage collector together. The details are in the Sisal case study.
How to get started with Akamas Insights
Insights is quick to set up. You install no agents, so nothing new runs inside your workloads. Insights collects metrics from the Insights is quick to set up. You install no agents, so nothing new runs inside your workloads. Insights collects metrics from the Kubernetes observability tools you already run, and it integrates with your existing monitoring stack, including Prometheus, Datadog and Dynatrace. It needs a read-only account to start analyzing your environment.
Cloud-native optimization should be accessible, safe and effective for every team, not only for specialists.
FAQs
What is Akamas Insights?
Akamas Insights is a Kubernetes optimization capability that analyzes clusters, pods and application runtimes. It detects optimization opportunities, estimates the savings behind each one, and recommends safe configuration changes. Coverage includes pod resources, HPA scaling policies, and JVM and Node.js runtime settings.
Does Akamas Insights need agents in my cluster?
No. Insights is agentless. It reads metrics that your Kubernetes observability stack already collects, such as Prometheus, Datadog or Dynatrace, and it needs a read-only account. Nothing runs inside your workloads, so setup does not touch application code or pod specs.
How is Akamas Insights different from pod rightsizing tools?
Pod rightsizing tools size the container. Insights also tunes what runs inside it. It covers pod requests and limits, HPA policies, cluster-level waste, and runtime settings such as JVM heap, garbage collection and V8 memory. Container sizing alone leaves both savings and reliability risks untouched.
Which application runtimes does Akamas Insights optimize?
Insights analyzes the JVM for Java workloads and V8 for Node.js workloads. It examines heap sizing, garbage collection settings and memory configuration, then checks them against the pod resources around them. A JVM heap that does not fit inside its pod memory limit is one of the most common findings.
Are the recommendations safe to apply in production?
Insights accounts for the application, not only the container, which is what makes a recommendation safe to apply. Every recommendation arrives prioritized and with its estimated impact, so you can review it first. Insights recommends; you decide what lands and when.
Node.js has emerged as a go-to server-side runtime environment for building high-performance web applications and is ranked among the top 3 popular languages in Kubernetes environments.
At the heart of Node.js lies V8, Google’s high-performance JavaScript engine. V8 provides 100s of configuration options and comes with default settings designed to work in a wide range of scenarios. However, these defaults might not be optimal for your specific applications and even lead to performance bottlenecks or unnecessary high resource usage.
Tuning V8 memory settings can improve Node.js performance by up to 45%. The same tuning can cut CPU usage by up to 68%, with no code changes. Those are the results of the Akamas optimization studies described later in this post.
Contrary to other popular runtimes like the JVM, .NET, and Golang, tuning V8 configurations is not an established and well-documented approach to optimize Node.js applications. As a result, most Node.js applications today run with default settings, leaving significant optimization potential on the table.
In this post, we describe how V8 memory management works and what are some of the key parameters that can be tuned. Then, we show the results of optimization studies we have conducted and how to achieve 45% gains in Node.js applications performance and 68% CPU usage reduction (hence cloud costs) by optimizing V8 configurations, all without touching the application code.
The Node.js performance stack
When thinking about performance and optimization opportunities, it’s important to understand that Node.js applications run on top of a technology stack, consisting of several layers each contributing to the overall application performance and resource usage.
Here’s the performance stack of a Node.js application running on Kubernetes:
In this post, we’re focusing on the V8 engine. Before deep-diving on it, let’s briefly describe the other components in the stack:
Application code: the JavaScript code that powers your application.
Node.js core: provides the APIs that you leverage to build your applications and the runtime system based on Libuv and the V8 engine.
Libuv: a multi-platform support library that handles asynchronous I/O operations, including worker threads that execute tasks that are too time-consuming to be handled directly within the Node.js event loop.
Kubernetes pod: defines the CPU and memory resources (requests and limits) that the application can use. This is crucial to ensure high-performance, cost-efficient, and reliable Node.js applications. It is a tricky process on its own; more on this in a future blog post.
The V8 engine
V8 is Google’s open-source, high-performance engine for JavaScript and WebAssembly. The V8 engine’s primary role is compiling and executing JavaScript code via Just-In-Time (JIT) compilation, as well as managing memory.
The first interesting aspect is that the V8 runtime is used for both server-side applications via Node.js and in web browsers such as Chrome. This is an important aspect, as those are two very different scenarios from a performance and efficiency perspective.
How does V8 navigate the tradeoff between application latency, throughput, and resource footprint? This is a complex design space for language runtimes, with many trade-offs (the same is true for Java and the JVM: see here). More on this later.
The second notable aspect that is less known about V8 is that it’s a highly configurable engine. As an example, the recently released Node.js version 22 has almost 800 configuration options for V8 only!
Even more interesting, if we look at the number of V8 options across Node.js versions, we see a steadily increasing trend.
What does that mean?
V8 is widely used in many diverse scenarios and it’s constantly being improved. More and more options are being added to tweak the runtime behavior. These knobs offer performance engineers and SREs a goldmine of optimization opportunities to extract more performance and efficiency out of Node.js applications. All without touching the JavaScript code!
In this post, we will focus on V8 memory management and some of the key configuration settings we can tune to optimize application performance and resource efficiency.
V8 memory management
Automatic memory management is a key benefit V8 provides to Node.js developers. But at the same time, it’s a crucial area that impacts your overall application performance and resource usage (hence cloud costs).
V8 engine manages memory via garbage collection. V8 provides a highly optimized, generational, stop-the-world garbage collector (GC) which is considered one of the keys to V8 performance.
Stop-the-world GC means that, when GC runs, the JavaScript code is stopped (i.e., your user requests will wait). This is why ensuring GC runs smoothly is paramount to maximizing application performance.
Generational means that most JavaScript objects die quickly after creation, while a small part lives longer. V8 leverages this hypothesis and divides the heap memory into two main pools: the Young (or New) generation, and the Old generation.
The young generation is where new objects are allocated. It is further divided into 2 semi-spaces equally sized (the To-space and From-space). By default, the young generation size is small (16 MB). A small young generation can cause excessive GC work, which in turn can impact application performance and CPU usage. The size of the semi-spaces is automatically selected by V8, but can be overridden via the –max-semi-space-size command line option:
docker run node:22 node --max-semi-space-size=256 <your-node-app.js>
The old generation stores objects that survived a number of GCs in the young generation. This space is usually bigger than the new space (up to 2GB). The size of the old generation is automatically selected by V8, but can be overridden via the –max-old-space-size command line option:
docker run node:22 node --max-old-space-size=1024 <your-node-app.js>
The young and the old generation are part of the overall heap. The heap also contains other spaces, which we won’t describe in detail in this post, as they are typically less important from a performance perspective.
Again, V8 automatically selects the maximum size of the heap (more on this later), but it can be overridden via the –max-heap-size command line option:
docker run node:22 node --max-heap-size=2048 <your-node-app.js>
We are now armed with a basic understanding of Node.js and V8 memory management and some of the most important configuration options. Let’s now see the impact performance tuning Node.js heap generations can have on your application performance and efficiency.
V8 heap tuning experimental setup and results
To explore the impact of tuning V8 heap generations, we set up an automated benchmarking process to launch a Node.js application under different configuration options and measure the corresponding performance metrics. Here’s our experimental setup:
Application: We leveraged web-tooling-benchmark, a standard benchmark that is designed to measure the performance of common JavaScript workloads.
Configuration parameters: We tested different values of V8 young and old generations size, namely –max-semi-space-size and –max-old-space-size.
Performance metrics: We measured benchmark execution time and total CPU time used by the benchmark.
Execution environment: We used Node.js v18. All experiments were run on EC2 instances.
So what results did we get?
Let’s first focus on application performance. The charts below show how execution time varies with the heap parameters. As you can see, the results are impressive: by tuning V8’s young and old heap generations, we got a performance speedup of 11% and 45% respectively.
Chart 1: Application performance vs Node.js max semi space sizeChart 2: Application performance vs Node.js max old space size
Another common question running Node.js applications on the cloud is about resource usage (which relates to cloud costs). Is it possible to reduce CPU or memory footprint of Node.js applications by tuning V8 configurations?
The answer is definitely yes! The charts below show how CPU time varies with the two V8 parameters. We can see massive resource usage savings: by tuning V8 young and old heap generations, the CPU used by the application was reduced by 22% and 68%, respectively.
Chart 3: Application CPU usage vs Node.js max semi space sizeChart 4: Application CPU usage vs Node.js max old space size
Overall, this Node.js tuning exercise shows two main takeaways:
Increasing memory assigned for the V8 heap generations, both application performance and resource footprint improve significantly.
Performance and resource footprint gains stop increasing after some point, and increasing resources beyond that point doesn’t help much.
The first aspect can be explained based on how the V8 garbage collector works: the bigger the heap, the more memory can be allocated before the need to do GC work. This clearly reduces CPU cycles used by the GC. Notice however that, as the heap gets bigger, GC pauses may get longer and start impacting your application tail latency (e.g. P90 and above).
The second aspect is interesting as it shows that a counter-intuitive cost-performance trade-off exists in Node.js applications. If you run your apps with too small a heap, you have poor performance and high CPU usage and costs. If you run with the optimal heap size, you get high performance and minimal costs. If you increase heap memory beyond this point, performance won’t increase and you’ll use more resources and increase costs without benefits.
Lastly, it’s worth noting that the optimal configuration is highly application-dependent. It is a function of the specific application code, the workload, and the execution environment, including K8s, hypervisor, OS, and hardware versions. There is no silver bullet, other than tuning your own applications!
Conclusions
Improving performance and reducing resource usage of Node.js applications is typically approached by tuning the JavaScript code. However, the V8 JavaScript engine powering Node.js applications has 100s of configuration settings that can be exploited by SREs and performance engineers to optimize application performance and reduce resource footprint and cloud costs.
In this post, we have shown that tuning V8 memory management and garbage collection can provide 2x or more application performance and resource efficiency gains, without touching the application code. If you want to apply the same approach across the JVM, Node.js and other runtimes, see the Akamas Application Runtimes solution.
In the next blog posts, we will explore how V8 determines default values for heap memory and how this choice can impact Node.js application reliability on Kubernetes.
Stay tuned!
FAQs
What does the –max-old-space-size flag do in Node.js?
It sets the maximum size (in MB) of V8’s old generation, where long-lived objects are stored. V8 auto-selects this value, but raising it gives the garbage collector more room before it must run, which can improve throughput on memory-heavy workloads.
What is –max-semi-space-size in Node.js?
It controls the size of each semi-space in V8’s young generation, where new objects are allocated. The default young generation is small (16 MB). Increasing it reduces how often minor garbage collection runs, which can lower CPU usage.
Does a bigger V8 heap always improve Node.js performance?
No. In Akamas benchmarks, gains plateaued past an optimal heap size. Beyond that point you spend more memory and cloud cost for no extra speed, and major GC pauses can grow and hurt tail latency (P90 and above).
Can you improve Node.js performance without changing application code?
Yes. V8 exposes hundreds of runtime flags. Tuning heap generations alone delivered up to 45% faster execution and 68% lower CPU in Akamas benchmarks, with no code changes.
Which metrics should you measure when tuning V8 for Node.js?
Track execution time (latency and throughput) and total CPU time. Also watch garbage collection frequency and pause duration, since tail latency can rise as the heap grows.