esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

Busy Frontend: Why Heavy Work at the Front End Makes Apps Freeze

How to spot a front end that does too much work, why it makes the whole app feel broken, and how to hand heavy jobs to a backend worker.

In short

A busy frontend does too much heavy work in the front end, which makes the whole app freeze, and the fix is to hand heavy jobs to a backend worker.

12 min readFree

What You Will Learn

Some apps feel broken even when the servers that hold their data are almost idle. Often the cause is the front end, the part of the system that receives user requests and prepares the screen, doing heavy work itself. System designers call this mistake the Busy Front End antipattern. The Azure Architecture Center describes performance antipatterns as practices that tend to cause scalability problems under pressure. This lesson shows you how to spot the pattern, why it hurts, and how to fix it.

Key words

Front end
The part of a system that talks to users. It takes their requests and sends back the pages or screens they see.
Antipattern
A common design habit that looks reasonable at first but causes trouble when the system is busy.
Thread
One line of work that a program runs. A server can only run a limited number of threads at once.
UI thread
The main thread of a phone or browser app. It draws the screen and handles taps and scrolling.
CPU
The processor chip that does calculations. Heavy work uses up CPU time.
Latency
The delay between a request and its answer. High latency means users wait.
Background job
A task that runs after the reply has been sent, outside the user's live request.
Queue
A line where tasks wait in order until something is ready to handle them.
Worker
A program, often on its own machine, that takes tasks from a queue and does them.
Starve
To leave something without the resources it needs, such as threads or CPU time.

What Is a Busy Frontend?

A busy front end is a system where too much heavy work runs in the layer that answers user requests, or inside the user's own app. Heavy work includes processing large amounts of data, building complex pages, and running business rules that take real computing time. Moving such work onto a side thread does not solve the problem on its own. Work on a side thread still uses the machine's resources, and too much of it can leave the threads that handle requests with nothing left to use.

The problem is not that heavy work exists. The problem is where it runs. Work that could wait, or that another machine could do, should not hold up the screen or the request handler. A front end is meant to answer quickly, so it should keep its time for that job.

How Do You Recognize It?

Recognizing a busy front end means looking at what users see and what the servers are doing at the same time. The pattern shows up as a set of symptoms, and each one has common causes. Start with the symptoms, then check which work is responsible.

What Are the Symptoms of a Busy Front End?

  • Frozen screen

    In a browser, taps and scrolling pause while a heavy calculation runs. When a browser is busy with long work, other actions wait too.

  • Slow responses from the front-end tier

    Pages take a long time to load, and some requests time out before they finish. Some users will report slow pages or failures when heavy tasks are running.

  • High CPU on web servers or devices

    The processor on a web server or a user's phone stays near its limit. Background work still draws heavily on the processor, so this sign can hide behind work that looks like it has been moved.

  • Error codes under load

    When the front end cannot keep up, it may return server error codes such as HTTP 500 or 503. Dependent services can also start to throttle requests as the load grows.

What Are the Typical Causes?

  • Heavy computation

    Math-heavy steps, such as editing images or running large calculations, run inside a request instead of elsewhere.

  • Large data transforms

    The page loads thousands of records, then reshapes them into totals, sorted lists, or charts every time someone opens it.

  • Work on request or UI threads

    Heavy tasks are started on the same threads that answer requests or draw the screen. Too many of them leave those threads with no capacity left for new users.

  • One big codebase

    This tends to happen when one codebase mixes business rules with screen code, so every feature lands in the front-end layer.

Tip

Start your search with timing. Find the pages or actions where response times jump, then check which heavy work they run. The pattern is usually clear once you line up slow moments with busy actions.

Why Does It Hurt?

A busy front end hurts because the front end is shared. Every user's request passes through the same threads and the same processor. When one kind of request grabs too much of them, every other request has to wait in line. The Azure guidance warns that resource-hungry work can slow down other operations, even simple ones.

The effect grows with the crowd. A single heavy action from one user may be fine. A moderate number of users sending the same heavy request at the same time can slow every page, not only the heavy one. In a multitenant system, which is one where many customers share the same app, one heavy job can slow the experience for every customer at once.

Why an Idle Backend Does Not Help

A common trap is to check the database, see that it is calm, and decide the system is healthy. The bottleneck is the front end, not the data store. Adding more front-end machines is usually the wrong first answer. More front-end capacity only spreads the same heavy work across more machines, and the app still feels slow to the person waiting.

Tip

Before you add servers, ask which tier is using the CPU. If the front end is busy and the work could wait, move the work first. Adding machines is a bigger bill for the same problem.

How to Fix It

The usual fix is to move heavy work off the front end and onto a backend service. The recommended method is queue-based load leveling. Load leveling means smoothing out spikes so that work arrives at a pace the backend can handle. The front end adds a task to a queue, and a backend worker takes the tasks in order and processes them.

  1. 1

    Find the heavy step

    Look for code that runs for a long time or uses a lot of CPU inside a request handler or the UI thread. Measure it before you change anything.

  2. 2

    Put a task on a queue

    The front end records what needs doing, such as the file to process and the settings to use, and places that message on a queue. Then it returns to the user quickly.

  3. 3

    Let a worker do the job

    A backend worker takes each message from the queue and does the heavy processing. If the queue grows too long, the backend can scale out with more workers.

  4. 4

    Show the result when it is ready

    The app tells the user the job is in progress, then shows the finished result once the worker is done. The user is never left with a frozen screen.

Keep the Front End Thin

A thin front end does a small set of jobs well. It receives requests, checks who is asking, draws the page, and runs small lookups. Heavy processing belongs in a service behind the front end, and the front end only passes it along.

The same idea works inside a browser. Browsers offer a feature called Web Workers, which runs heavy scripts on a helper thread, so the main thread stays free for clicks and layout. The principle is the same as on a server: keep the thread that talks to the user free.

Trade-offs of Offloading

Offloading is not free. Each fix adds parts to the system and changes how users experience the wait. A good designer weighs the gains against the new costs before moving work.

  • Slower finish

    Offloaded tasks can take longer to complete than they would have inline. The user waits for the result later, so the wait has to be shown clearly.

  • Faster reply

    The front end's reply speed depends on how quickly it can add a job to the queue. Adding a message is normally quick, because it only records what needs doing.

  • More moving parts

    The app must handle queuing safely, so no request is lost if something fails. It also depends on a message queue service, which must be kept running.

  • Capacity planning

    The processing environment must be large enough for the expected load. Otherwise the queue grows and results arrive late.

Tip

Offloading trades a fast screen for a slower result. Tell users what is happening, such as with a status message, so the wait feels honest rather than broken.

Worked Example: A Photo-Sharing Upload

Imagine a photo-sharing app. When a user uploads a full-resolution photo, the upload screen resizes it, applies filters, and compresses it, all inside the web request handler or the phone's UI thread. The screen freezes while this runs. Other users' requests also queue up behind it, because the same server threads are busy. The app looks broken even though the database is fine.

The fix keeps the upload fast and moves the image work to a worker. Here are the steps.

  1. 1

    Accept the upload

    The server saves the original photo to storage right away.

  2. 2

    Queue the image job

    The app adds a message to a queue. The message holds the photo's ID and the filter and size settings, but not the image pixels. The handler then returns a reply that the upload was accepted.

  3. 3

    Worker processes the image

    A worker takes the message, reads the original, resizes it, applies the filter, compresses it, and saves the new versions. Other users' requests keep flowing because the web threads are free.

  4. 4

    Show the result

    The app shows a 'processing' note on the photo. When the worker finishes, the app shows the finished photo to the user, who can now see it in the feed.

Tip

Store the original file before you queue the job. If the worker crashes, the original is still there, and the job can run again.

Try It in Python

The sample below copies the shape of the photo fix. The upload handler only adds a job to a queue and returns at once. A worker runs later and does the slow part. A plain deque stands in for a real message queue, so the code runs with the standard library only.

Python
from collections import deque

jobs = deque()

def handle_upload(photo):
    jobs.append(photo)
    return 'accepted ' + photo

def run_worker():
    done = []
    while jobs:
        photo = jobs.popleft()
        done.append(photo + ' resized')
    return done

print(handle_upload('cat.jpg'))
print(handle_upload('dog.jpg'))
print(run_worker())

Output

accepted cat.jpg
accepted dog.jpg
['cat.jpg resized', 'dog.jpg resized']

Notice what the handler does not do. It never calls the resize step. That is the whole idea: the request path stays short, and the heavy step waits in the queue until a worker is ready. A real system would use a message broker and separate machines, but the shape of the flow is the same.

Check Your Understanding

Try these two scenarios. Each one asks you to apply the idea, not just repeat it.

Quick check

An online store's web servers hit 95% CPU every time a user opens the order-history page. The page code loads thousands of orders and computes totals and charts on the spot, while the database sits mostly idle. What is the problem, and what would you change?

A second scenario uses a phone app rather than a server. Read it and think about where the heavy work should go.

Quick check

A mobile app freezes for two seconds each time a user taps Export, because the phone resizes a long list of photos on its UI thread. The company's servers are idle. What is the best first change?

Key Takeaways

A busy front end happens when heavy work runs in the layer that answers users or inside their app. It shows up as frozen screens, slow replies, and high CPU, and it slows everyone, not only the heavy action. The fix is to move heavy work to a backend worker through a queue, keep the front end thin, and accept the trade-off of a slower finish for the heavy job. Your next step is to find one heavy action in a system you know and ask where its work should run.

Sources

How is this lesson?

Last updated on 18 November 2026

Learn with me

Every lesson is free. I add new ones as I learn. Have a question, or want help with your own work? Book a short call.