Marco Behler - Why you don't need to worry about scaling your Java webapp
Provides marco Behler - Why you dont need to worry about scaling your Java webapp and evaluates key implications for security practitioners.
Summary
### Overview In this talk, Marco Behler addresses common engineering anxieties and business assumptions surrounding web application scalability. Developers often face pressure to prepare for thousands of concurrent users or large traffic spikes without clear metrics. Behler argues that rather than resorting to premature over-engineering—such as complex Kubernetes clusters or arbitrarily selecting expensive AWS EC2 instances—teams must adopt an empirical, rigorous load-testing methodology combined with realistic expectation management.
### Key Topics - **Structured Load-Testing Architecture**: Why load testing should never be conducted from a local developer machine, and how separating load generation from latency measurement yields reliable data. - **Multi-Layer Telemetry and Verification**: The necessity of collecting system-level and JVM metrics across all participating nodes to ensure load-testing tools themselves do not skew results. - **Latency Distribution and Percentiles**: How High Dynamic Range (HDR) histograms reveal true latency patterns and response spikes compared to basic average figures. - **Real-World Architectural Considerations**: Bridging synthetic benchmarks to production realities by mapping user journeys and identifying bottleneck dependencies like databases and microservices. - **Expectation Management**: Countering inflated user concurrency projections with real-world industry benchmarks.
### Technical Details Behler demonstrates a benchmarking framework inspired by and built with guidance from the Jetty development team. The test harness provisions nodes on AWS EC2, configured as follows: - **Server**: A single instance hosting an embedded Jetty web application with a simple `doGet` servlet returning a JSON payload (`/taxrate`). - **Loaders**: Multiple dedicated EC2 nodes (four loader machines in the demonstration) tasked exclusively with generating target throughput (ranging across tests from 1,000 to 40,000 requests per second) to prevent client-side resource exhaustion. - **Probe Node**: An isolated lightweight client that sends 1–2 requests per second to measure latency independently without contending for client CPU or network bandwidth.
During testing, Behler captures operational telemetry at 10-second intervals across every node: - **Operating System Metrics**: CPU utilization (ensuring loaders remain largely idle, around 98% idle, to avoid client-side bottlenecks), memory allocation, network throughput (received and transmitted kilobits per second), and TCP packet rates. - **Application and JVM Metrics**: Execution time spent purely within the servlet business logic (excluding Jetty network layer overhead), profiling via async profiler flame graphs to inspect thread execution down to method-level CPU time, and JVM pause monitoring via jHiccup. - **Findings**: At 1,000 to 20,000 RPS, response latencies stayed between 1 and 5 milliseconds with modest server CPU utilization. However, at 40,000 RPS, server CPU spiked to over 90–93%, causing the HDR histogram's 99th+ percentiles to sharply degrade from 1.4 milliseconds to over 140 milliseconds.
### Takeaways - **Validate the Benchmark Environment**: Load test results are invalid if loaders become saturated or if requests return 4xx/5xx errors; verify CPU, network, and HTTP status codes across all test participants. - **Architectural Bottlenecks**: In real-world multi-tier systems, the web server is rarely the primary constraint; backend dependencies like databases or microservices dictate throughput limits. - **Manage Scale Expectations**: Most business applications experience modest continuous request volumes rather than thousands of sustained requests per second (e.g., Stack Exchange averages ~300 RPS and peaks at ~450 RPS across nine web servers). Teams should test against realistic, buffered load targets rather than chasing extreme artificial breaking points.
Related talks
GeeCON·49 min
Design a Scalable Product · Engineering Methodology
Analyzes roman Pichlik and evaluates key implications for security practitioners.
GeeCON·49 min
Maja Rydzy
Outlines maja Rydzy - Web 3.0 through the eyes of JVM dev and evaluates key implications for security practitioners.
GeeCON·47 min
OOP Revisited
Outlines dominik Przybysz and evaluates key implications for security practitioners.


