System performance
We write about how to check that a system will handle the traffic before your customers find out. We cover the types of performance tests, the tools, reading percentiles and finding bottlenecks in the database, cache and queues. Plus observability, SLOs and capacity planning for transactional systems.
19 articles · B2Bnetwork team
19 articles
- 01Load, stress and endurance tests: how they differA load test checks whether the system meets requirements at expected traffic, e.g. in the peak hour. A stress test raises traffic above the forecast until the system stops keeping up, and shows where the limit lies, how the system fails and whether it recovers on its own. An endurance test holds typical load for many hours and catches memory leaks, growing queues and filling disks. Each answers a different question, so a good plan combines all three.6 min
- 02Percentiles instead of averages: how to read p95 and p99 response timesThe p95 percentile is the time within which 95% of requests complete; p99 is the time within which 99% complete. The average blends fast and very slow responses into one number that often matches no real request and hides customers waiting several seconds. Performance requirements are therefore written in percentiles: the median describes the typical experience, p95 and p99 the worst cases that customers remember and report.6 min
- 03Performance testing before a sales peak: a step-by-step planPerformance testing before a sales peak starts with a business forecast turned into numbers: orders per hour, sessions, path proportions. On that basis you build a traffic model, scripts and data, and then a series of tests checks the system at the forecast level, above it and over many hours. The last step is a plan for peak day: a change freeze, ready decisions in case of overload and monitoring. It is worth starting a few weeks earlier, because fixes also have to be tested.6 min
- 04JMeter, Gatling or k6: a comparison of performance testing toolsChoose Apache JMeter when the team tests many protocols (HTTP, JDBC, JMS, LDAP) and prefers building tests in a graphical editor. Gatling suits teams that write tests as code in Java, Kotlin or Scala and need an efficient generator with a readable report. Grafana k6 is written in JavaScript and plugs easily into CI/CD thanks to thresholds that fail the test with an error. All three have open cores; the choice depends on the system's protocols and the team's skills, not on a ranking.6 min
- 05Database bottlenecks: how to find them before productionYou find database bottlenecks by combining a load test with measurements on the database side: a list of the queries with the greatest total time, their execution plans, lock waits, and the state of the connection pool. The key condition is production-scale data, because a query plan on a small table can be completely different from the plan on a large one. Most problems come down to a few queries without a proper index, the N+1 pattern from object-relational mapping, hot rows, and a connection pool that is too small or too large.6 min
- 06Core Web Vitals: a performance budget for a web applicationCore Web Vitals are three measures of a page's user experience, described by Google on web.dev: LCP (loading of the main content, good up to 2.5 s), INP (response to interaction, good up to 200 ms), and CLS (layout stability, good up to 0.1). They are assessed at the 75th percentile of visits, separately for phones and desktops. A performance budget turns these thresholds into rules for the team: limits on the metrics and on the weight of scripts and images, checked automatically with every change.6 min
- 07Performance tests in CI/CD without false alarmsPerformance tests in CI/CD produce false alarms when they measure noise instead of a change in the code: shared machines, a cold application start, too few measurements, and rigid absolute thresholds. You reduce them with a stable environment, a warm-up excluded from the assessment, several runs judged by the median, and a comparison with a baseline result from the same environment with a set tolerance. Tests are split into layers: short ones on every change, full ones nightly and before a release.6 min
- 08Capacity planning for transaction systemsCapacity planning answers the question of how many resources a transaction system needs to meet its requirements at forecast traffic, with headroom for failure and growth. It starts by converting a business forecast into transactions per second at the peak, then a test measures the capacity of a single node and the resource that runs out first. The plan accounts for the nonlinear growth of response times at high utilization, the loss of one node, batch jobs overlapping with traffic, and external limits.6 min
- 09Observability: logs, metrics, and traces in a distributed systemObservability is the ability to answer the question of why a system behaves the way it does, based on the data it emits itself. Metrics tell you that something is happening and how often, traces show where in the chain of services the time of a single request goes, and logs explain exactly what happened. In a distributed system they are tied together by a shared trace ID. OpenTelemetry provides one open standard for collecting all three signals, independent of the tool vendor.6 min
- 10An environment for performance testing: how close to production it must beA performance test environment must be identical to production in whatever affects bottlenecks: architecture, versions, configuration, the size and distribution of data, and the way layers communicate. It can differ in the number of nodes, provided you know which resource is shared and how the system scales horizontally. A scaled-down environment gives reliable results for a single node, but you cannot extrapolate them linearly to the whole of production, especially when the database is the bottleneck.6 min
- 11SLOs and error budgets: how to agree with the business what "fast" meansAn SLO (service level objective) is an agreed target for a measurable characteristic of a service, e.g. "99% of logins complete in under 1 s over a 30-day window". The error budget is the allowed remainder: with a 99.9% target, that is 0.1% of requests, or about 43 minutes in 30 days. This turns "fast" and "reliable" into numbers that the business and the IT team approve together, and the budget tells you when you can ship new features and when you need to focus on reliability.6 min
- 12Application caching: when it speeds things up and when it causes bugsA cache speeds up an application when the same data is read far more often than it changes and a short delay in updates is acceptable. Typical examples are product catalogs, reference data, price lists and the results of expensive calculations. Bugs appear with data that must always be current (account balances, stock levels at reservation, permissions), with a poorly chosen time to live, and when many keys expire at once during peak traffic.6 min
- 13Database connection pool: how to size and configure it for loadA database connection pool should be small and fixed in size, calculated from traffic and connection hold time rather than from the number of users. A pool that is too small makes threads wait while the database has spare capacity. One that is too large floods the database with parallel queries and slows everyone down. Three more settings matter: the timeout for acquiring a connection, a maximum connection lifetime shorter than network and database limits, and the total across all instances compared with the database limit.6 min
- 14Memory leaks in the JVM and .NET: how to detect them in endurance testsYou detect a memory leak in the JVM or .NET with an endurance test: typical load for many hours while you watch memory occupied after each full garbage collection. If that value keeps rising, something holds references to objects the application no longer needs. Two class histograms or heap dumps compared with each other point to the cause, and so does the path from the growing objects to a GC root, such as a static collection, an unbounded cache or an event listener that was never unregistered.6 min
- 15Kubernetes autoscaling: HPA, resource limits and load testingKubernetes autoscaling works when pods have resource requests set, the HPA scales on a metric that rises with traffic, and a load test has confirmed how fast replicas appear. The HorizontalPodAutoscaler computes CPU utilization relative to requests, so without them it does not scale at all. The replica count must also fit the rest of the system (the database, connection pools and external API limits), because new pods move the bottleneck elsewhere rather than removing it.6 min
- 16SQL query performance: execution plans and indexes in practiceYou fix a slow SQL query by reading its execution plan: in PostgreSQL with EXPLAIN (ANALYZE, BUFFERS), in SQL Server with the actual execution plan. The plan shows how the database reads, joins and sorts tables, and how many rows it expected versus how many it got. The biggest gains usually come from three things: a composite index with columns ordered equality first, then range; a condition written so the index can be used; and current statistics. Verify every change on production-scale data.6 min
- 17Profiling applications in production without putting users at riskYou profile an application in production safely with sampling tools whose overhead is low and measured, such as JDK Flight Recorder for the JVM and dotnet-trace for .NET, for a limited time and usually on one instance. A profile shows which functions consume CPU time, where the application waits and how much memory it allocates, on real traffic and real data. High-impact operations, such as heap dumps or instrumenting every method, belong on an instance taken out of traffic.6 min
- 18Message queues and asynchronous processing: how to offload a system at peakA queue offloads a system at peak because it accepts work faster than the work can be done and hands it to consumers at a pace the database and external systems can sustain. This only works when the user does not need the result immediately and, on average, consumers keep up with the inflow. Without acknowledgements, a bounded number of retries, a dead-letter queue and idempotent consumers, a queue turns a peak into lost or duplicated operations.6 min
- 19Mobile app performance: startup time, smoothness and battery usageMobile app performance comes down to three measures users feel without any tools: cold start time, smooth scrolling and animation, and battery usage. On Android, smooth rendering at 60 frames per second means drawing each frame in under 16 ms, and a main thread blocked for 5 seconds on a touch ends in an ANR error. Measure on real devices, including low-end ones, in a release build, and confirm results with data from users' phones: Android vitals and MetricKit.6 min
Didn't find the answer to your question?
Tell us what you're dealing with. An engineer who has worked on a similar system will answer.