Skip to main content

Slow server response time? This is how to find the real cause

Slow server response time? This is how to find the real cause

Two seconds. That is how long a page can take to start responding, and on paper it is nothing. In practice it is exactly the moment a visitor clicks away, an employee hits refresh one more time and an integration runs into a time-out. The annoying part is that nobody can see where those two seconds go. So the wrong dial gets turned first: a bigger server, while the real brake sits somewhere else entirely.

Server response time is the gap between a request from a browser, app or integration and the first piece of the answer coming back. You will see it reported as Time to First Byte, usually shortened to TTFB. A low TTFB does not yet mean a site or application feels fast, because images, scripts and rendering still have to do their bit afterwards. A high TTFB, on the other hand, almost always means something on the server side is sitting and waiting.

Why there is rarely a single culprit

Hosting is the easiest suspect, and sometimes it really is the problem. Too little memory, an overcrowded shared environment or a configuration that was never revisited after a growth spurt will slow things down straight away. But in most of the environments we look at under the bonnet, the waiting time is made up of small pieces spread across infrastructure, application code, database and third-party services. None of those pieces is dramatic on its own. Together they certainly are.

A product page is a good example. Before anything can appear on screen, the application fetches stock levels, recalculates prices, checks customer-specific agreements and pulls in recommendations. If all of that happens in separate queries and separate API calls, the clock keeps ticking along. The server is not doing too little, it simply has too much to get through before it is allowed to send anything back.

Peak load exposes that kind of build-up painfully well. An environment that works fine with twenty concurrent users can grind to a halt during a campaign or a month-end close. Nothing is broken at that point. The number of processes, the number of database connections or the available processing power has just hit the ceiling. Without measurements, that is indistinguishable from "the server is slow".

Measure first, and not just the homepage

A baseline measurement is only useful if it resembles real usage. The average response time of your homepage says very little about that. Measure the processes where time and money sit: signing in, searching, placing an order, opening a report, syncing data, loading the customer portal. That is where delay is felt, and where the damage happens.

Next, break the total time into parts. How much of it is network? How much sits in the web server and the application? Which queries cost time? Is something waiting on an external API? That breakdown prevents the classic scenario in which developers spend weeks on code while the actual bottleneck is an overloaded database or a hosting environment that is simply too tight.

Look at percentiles rather than averages while you are at it. An average of 300 milliseconds sounds excellent, even when ten percent of requests take five seconds. For the user who wants to check out or publish at that exact moment, the average does not exist. The slow tail is where you need to be: what do those requests have in common? The same time of day, the same customer, the same report, the same table?

Most analyses end up touching four layers:

  • CPU, memory, disk speed and network capacity of the server itself;
  • the web server and runtime, including settings for processes, workers and connections;
  • the application code, background jobs and everything that depends on external systems;
  • the database, with its slow queries, missing indexes, locks and connection limits.

Treat that list as a handy checklist, not a ranking. We have seen environments where one badly written query delivered more improvement than doubling the capacity, and environments where the code was perfectly tidy but the server had been bought far too small from the start. Only after measuring do you know which of the two you are dealing with.

Give the infrastructure an honest baseline

Hosting should match what actually happens, not the number of pages or users in a spreadsheet. A webshop with heavy product filters has different needs than an informational site with the same visitor numbers. A SaaS platform with lots of concurrent sessions, scheduled jobs and API traffic needs something else again. Anyone who only looks on a quiet Tuesday afternoon almost always buys too light.

So check how the environment behaves during a peak. Is the CPU pinned at its limit for long stretches, are queues building up, are processes being killed because memory ran out? Then scaling up is a defensible choice. Faster storage mainly helps when there is a lot of reading and writing: large databases, heavy logging, file processing.

Extra capacity is not a free pass, though. A job that walks through thousands of records every minute without anyone remembering why stays expensive and fragile, even on a faster machine. In practice this order works best: strip out the biggest chunk of wasted work first, then scale up for growth and peaks. That way you pay for headroom instead of paying for mess.

The layout matters as well. If the database sits far away from the application, every extra call weighs more heavily, because the latency counts each time. If several critical systems share one machine, a single heavy monthly report can slow down the customer environment. Separating roles brings more predictability, but it also costs management time and money. That only makes sense once the load or the business impact justifies it.

Tackle database delay where it starts

In business applications the database is often the largest source of waiting time, and usually nobody notices. The interface still works fine, but behind every user action sit dozens of queries politely waiting for each other. While the tables are small, it goes unnoticed. At five times the records or users, it suddenly becomes the talk of the day.

Start with two lists: the slowest queries and the most frequently executed ones. The causes are often familiar. A missing index, a select that pulls far more columns than needed, a filter on a field that has no index on it. And watch the queries that are fast in isolation. Two milliseconds is nothing, until it happens three hundred times inside the same request.

Locks and transactions deserve separate attention. If one process holds a table for a long time, other processes stand still while the CPU does almost nothing. The user sees a slow page, and in the monitoring the server looks perfectly healthy. In financial, stock or planning processes this calls for care: gaining speed must never come at the cost of consistent data.

Caching takes a lot of work off the table, certainly for data that is identical for everyone, such as product information, configurations and navigation structures. For personal data, live stock levels and price calculations you need clear agreements about refreshing and invalidating. A lightning-fast page showing last week's price costs a business more than a page that is 200 milliseconds slower and correct.

Let a single request do less work

A lot of response time is lost because a request tries to finish too much in one go. Someone uploads a file and then waits for a conversion, an email notification and a sync with the ERP. None of that is needed for the answer to that user. Jobs like those belong in a queue, where a background worker picks them up.

It is not free, mind you. Background jobs need monitoring, failures need to be retried and the processing order has to hold up. Without those arrangements you trade a slow request for unreliable processing, and that is the worse deal.

External APIs are a category of their own. A payment provider, CRM, ERP or shipping partner can slow your request down while your own server is sitting idle. So put time-outs on every outgoing call, log what comes back and make sure an outage at a third party cannot block an entire page. Where you can: sync asynchronously, or keep a recent copy available locally.

Keep an eye on releases too. New functionality nearly always brings extra queries, scripts or integrations with it. Build a performance check into the development process, especially for systems that are used all day. A change that is functionally correct but makes every request 400 milliseconds more expensive is something you want to see before it ships, not three weeks later in a complaint.

Speed is maintenance, not a project

You do not sort out fast server responses once and then stop looking. Traffic grows, tables fill up, integrations change and users find routes nobody anticipated. Continuous monitoring is the difference between stepping in yourself and hearing the news from a customer.

Set thresholds for response time, error rates, CPU, memory, database connections and queue length. Combine those technical signals with what you know about the business process. A spike in usage is good news when a campaign lands and bad news when orders get stuck because of it. A threshold will not make that distinction for you.

Finally, make ownership clear. With an external developer, a separate hosting company and two software suppliers in the mix, a performance problem disappears easily into the space between the parties. When development and hosting sit in the same hands, the route to the cause is shorter. That is how we work at LJPc: not just establishing that something is slow, but working out why and then fixing it.

The best next step is almost never ordering the biggest server. Pick one process that demonstrably loses time, measure the full chain from browser to database, and improve the link that gets in the way most. That delivers results sooner, keeps costs explainable, and gives your organisation back the feeling that the technology is working with them.

Stay up to date with recent developments! Subscribe and receive our newsletter Signing up...