Skip to content
EncryptTechBD
Home Industries Our Work Blog Pricing About Contact Discuss Your Project
বাংলা (BN)
Software Engineering 5 min read

Web application performance problems and how to fix them

A symptom-led troubleshooting guide for slow web applications: server time, database queries, session handling, caching, third parties and front-end delivery.

E
EncryptTechBD · 0 comments
Woman typing on a laptop at a desk
Photo: LinkedIn Sales Navigator / StockSnap

A slow web application is a chain of handoffs: the browser, the network, the web server, the application code, the database and every third-party service called along the way. The visible symptom is usually at the end of that chain, which is why replacing the server rarely fixes a problem caused by one unbounded query. Work backwards with measurements, not theories.

Read the symptom by pattern

The pattern of slowness narrows the search before any tool is opened:

  • Every page is slow for everyone, all day. Look at server time, database health and capacity before the front end.
  • Only signed-in users are slow. Personalised queries, session storage and per-user permission checks are the likely causes.
  • Only writes are slow. Locks, transactions, synchronous external calls and audit logging deserve attention.
  • Only reports and exports are slow. Unbounded queries, memory limits and missing pagination are common.
  • Fast in the office, slow on mobile data. Payload size, image weight, render-blocking scripts and network latency.
  • Intermittent 502 or 504 errors at peak. Worker exhaustion, connection limits or an upstream timeout that is set too low.

A diagnostic sequence that avoids guesswork

  1. Name one slow transaction in business terms, such as "confirm an order" or "open a customer statement".
  2. Record the timing from a real device and a real network, then repeat it in a controlled test.
  3. Split the request into network, server and browser time. Do not tune the front end when the server takes most of the time.
  4. Decompose server time into application, database and outbound HTTP calls.
  5. Profile the slowest request and count database queries. A page issuing hundreds of small queries is an N+1 problem, not a database capacity problem.
  6. Inspect the slow query log and run EXPLAIN on the worst statements before adding indexes.
  7. Check cache hit rate, expiry and invalidation. A cache that misses on most requests adds latency instead of removing it.
  8. Reproduce peak load with a scripted test, then watch workers, connections, memory and queue depth.
  9. Change one cause, verify in the same test, and record the result with a date and version.

Symptom, likely cause, fix and prevention

Slow for every user, all day

Likely cause: time to first response is dominated by server work, usually an inefficient query or a synchronous call to another service. Fix: cache the expensive read, add the missing index, or move the outbound call to a queue with a visible status. Prevention: set a response-time budget per route and alert when the monthly median drifts above it.

Slow only after sign-in

Likely cause: each page rechecks permissions with several queries, or session data is read from a shared file store. Fix: load roles in one query, cache permission decisions briefly and move sessions to a dedicated store. Prevention: test the signed-in journey, not the public homepage, in every release check.

Slow on checkout and other writes

Likely cause: long transactions, row locks or a payment gateway call inside the request. Fix: shorten the transaction, reserve stock with a deliberate pattern, and give every external call a timeout and a fallback. Prevention: load-test the write path with duplicate submissions and retries, because that is how real buyers behave.

Slow during reports and month-end

Likely cause: a report scans an entire table, joins several large tables and builds the file in memory. Fix: paginate, pre-aggregate, cap the date range and run heavy exports as background jobs. Prevention: publish a report catalogue with expected run times and owners.

Fast in the office, slow on mobile

Likely cause: a large JavaScript bundle, uncompressed images or render-blocking third-party tags. Fix: compress and size images, defer non-critical scripts and remove tags nobody can justify. Prevention: keep a page-weight budget and test on a throttled connection before each campaign.

Intermittent 502 and 504 errors at peak

Likely cause: PHP workers or database connections are exhausted, or an upstream proxy times out before the application finishes. Fix: size workers against measured concurrency, add queueing for burst work and align timeout values across the chain. Prevention: monitor saturation, not just uptime, and test the limit before a seasonal campaign.

What not to do

  • Do not add a caching plugin before confirming that stale data will not break checkout or stock display.
  • Do not add indexes to every column; each index slows writes and consumes storage.
  • Do not raise PHP memory limits to hide an unbounded query.
  • Do not move to a larger server when the application is waiting on a third-party API.
  • Do not accept a single lab score as proof that real users will feel an improvement.

Prevention that survives the next release

Performance engineering is mostly a set of small constraints kept in place. Give each critical route a query-count and response-time budget. Run a load test on the checkout journey before peak season. Keep synthetic checks for the three transactions that matter most, with alerts routed to a named person. Record every incident with the cause, the fix and the guardrail added, so the same failure does not return under a new feature name.

In Bangladesh, test on the connections customers actually use. A fibre connection in Dhaka will hide problems that appear on a mid-range Android phone in a district town, especially during evening peaks. Segment measurements by device and network, and treat the checkout path as the priority because that is where latency turns directly into lost revenue.

Getting help with diagnosis

We diagnose and repair application performance through Custom Software & Integrations, from query design to deployment and monitoring. Engagement scope is explained on the pricing page. For the field-data side of the same problem, read the Core Web Vitals diagnosis guide.

Sources

Services that deliver this

Want this implemented properly?

Pricing →

Every engagement starts with a written scope. If a requirement is outside it, we quote it separately before starting.

Responses (0)

No comments yet. Add the first one below.

Leave a response

Your email address will not be published. Required fields are marked *.

Keep reading

More field notes