Engineering Blog · Enterprise Architecture

ERPNext Performance Problems: A Practical Debugging Checklist

“ERPNext is slow” is not a diagnosis. Isolate the affected layer, workload, and transaction with evidence before changing the system.

Start by defining what “slow” means

Slow login, form loading, document save, list views, reports, search, APIs, scheduled work, and delayed background jobs are different symptoms. Peak-period degradation is different again.

State the operation and expected behavior precisely. Otherwise teams may optimize unrelated components while the actual delay remains.

Reproduce before optimizing

Record the action, user role, document type, data volume, time, elapsed duration, consistency, affected users, staging behavior, and recent deployment or data changes. For intermittent issues, capture correlated evidence while the event occurs.

Break the system into layers

Browser → Web/API → Frappe/Python → Workers/Redis → Database/Files/External APIs → Network/Infrastructure

Measure boundaries. A long browser waterfall with a fast server response is not a database investigation; a fast request that only enqueues work shifts attention to queues and workers.

Check the database early—but not automatically first

Slow queries, large scans, ineffective indexes, expensive joins, lock contention, growing tables, and inefficient custom queries are common suspects, not the only ones.

Capture the actual query and execution behavior. Add indexes only when real access patterns justify them; indexes carry storage and write costs and may not help the problematic query.

Inspect custom reports

Reports may join many records, repeat calculations, use broad ranges, or fetch unnecessary columns. Use selective filters, query optimization, evidence-based indexes, prepared or background reports, and precomputed summaries where appropriate. Large analytical workloads may belong on a reporting platform.

Inspect custom code

Look for expensive validation hooks, nested access, queries inside loops, repeated document loading, unnecessary writes, synchronous third-party calls, and missed batching.

The N+1 pattern loads a list and then queries for every row. Measure query count as well as individual query duration.

Decompose document save performance

A save or submit may execute permissions, validations, hooks, child-row operations, stock or accounting effects, notifications, integrations, and custom scripts. Trace each major phase and dependency. Removing business controls is not a performance strategy.

Inspect background workers and queues

Frappe supports queued background work and multiple worker paths. Delays may come from saturation, long jobs, backlog, scheduled work, or poor workload distribution. Large jobs may benefit from bounded chunks with idempotency and progress tracking.

Background work protects request latency only when delayed completion is acceptable. It does not reduce total work and can hide failures unless queue depth, job age, duration, and retries are visible.

Treat Redis and caching as dependencies, not magic

Frappe uses Redis-backed facilities for caching and queue-related workloads. Check availability, latency, memory pressure, connection errors, and version-appropriate behavior.

Excessive misses remove caching benefit; stale caches damage correctness. Cache stable, expensive data with clear invalidation ownership.

Measure API performance end to end

Chatty designs, repeated authentication, excessive fields, weak pagination, unbounded filters, and serial requests can make integrations slow. Separate server time from network and downstream latency, and measure the complete business operation.

External integrations can block a transaction

A page or save may wait for payments, logistics, CRM, machine services, messaging, or custom applications. Use explicit timeouts, bounded retries, asynchronous processing where appropriate, failure isolation, and correlation identifiers. Customization debt often appears when calls are scattered through hooks.

Do not overlook frontend performance

Large responses, repeated requests, heavy client scripts, complex forms, many child rows, oversized payloads, and attachments can overwhelm the browser. Use browser timing to distinguish download, rendering, scripting, and server wait time.

Review file and attachment handling

Large uploads, image-heavy documents, backups, network storage, and object storage can add I/O or network delay. Determine whether a request waits for transfer, transformation, permissions, or storage response.

Infrastructure evidence provides context

Check CPU, memory, disk latency, database pressure, network behavior, workers, and contention with other workloads at the same timestamp. There is no universal users-to-CPU formula; capacity depends on workload and custom behavior.

Data growth changes query behavior

Sales, stock, accounting, item, communication, version, and logging records grow differently. Track table and index growth, retention requirements, query selectivity, and archival needs. Never delete history without an approved retention and reconciliation strategy.

Observability turns optimization into engineering

Monitor request latency, errors, queue depth, job age, worker utilization, slow queries, CPU, memory, disk, and external latency. Retain a baseline and correlate requests or jobs across layers. Optimization without measurement can merely move the bottleneck.

A practical debugging checklist

Reproduce

  • What exact action is slow, for whom, and for how long?
  • Can it be reproduced, and did it follow a change?

Application

  • Which hooks and custom code execute?
  • Are database calls inside loops or external calls inside transactions?

Database

  • Which query is slow and what plan does it use?
  • Are filters selective and indexes appropriate?

Background jobs and integrations

  • Are queues backed up or workers saturated?
  • Is ERPNext waiting on another system?

Infrastructure, data, and frontend

  • What do resource metrics show at the same time?
  • Did data volume change?
  • Are repeated requests or large payloads involved?

Avoid these “fixes”

  • Random indexes without query evidence.
  • Larger servers before locating the constraint.
  • Disabled validations or permissions.
  • More workers without understanding workload.
  • Caching everything.
  • Framework-internal modifications.
  • Deleting history without a retention plan.
  • Blaming ERPNext before investigating custom code.

Use a repeatable investigation order

  1. Reproduce.
  2. Measure.
  3. Isolate the layer.
  4. Inspect recent changes.
  5. Identify the expensive operation.
  6. Verify database behavior.
  7. Inspect workers, storage, network, and integrations.
  8. Make the smallest evidence-backed optimization.
  9. Regression-test behavior and performance.
  10. Monitor after deployment.

The final takeaway

Performance engineering is not about making every component faster. It is about identifying the component actually responsible for the delay and fixing that bottleneck without introducing new ones.

Summary: “ERPNext is slow” is not a diagnosis. Performance problems must be isolated by layer, workload, transaction type, and evidence before they can be fixed safely.

By Vishleshak Technologies · Published · Modified