Troubleshooting Guide: My Website or App is Slow Print

  • 0

Performance Diagnosis Flowchart

Identify and fix performance issues with your ASP.NET Core application on Plesk Windows hosting.

Step 1: Where is the Slowness?

Initial page load is slow (5+ seconds)
→ Go to Section A: Cold Start Issues
All requests are slow
→ Go to Section B: General Performance
Database operations are slow
→ Go to Section C: Database Performance
Occasional slowness/timeouts
→ Go to Section D: Intermittent Issues

Section A: Cold Start / Initial Load Slow

Causes & Solutions:

  1. Application Pool idle timeout
    • Default: 20 minutes idle = app unloads
    • Fix: Increase idle timeout in Plesk → Dedicated IIS Application Pool
  2. Large application / many dependencies
    • Fix: Consider ReadyToRun compilation:
      <PublishReadyToRun>true</PublishReadyToRun>
  3. JIT compilation on first request
    • Fix: Use warmup scripts or Application Initialization

Section B: General Slow Performance

Check These Items:

  1. Enable compression
    builder.Services.AddResponseCompression();
  2. Enable caching
    builder.Services.AddResponseCaching();
    builder.Services.AddOutputCache();
  3. Minify CSS/JS - Use bundling in production
  4. Optimize images - Use WebP format, lazy loading
  5. Check for synchronous I/O
    • Use async/await for all I/O operations
  6. Review logging level
    • Set to Warning or Error in production

Section C: Database Performance

Diagnostic Steps:

  1. N+1 Query Problem
    • Symptom: Many small queries instead of one
    • Fix: Use Include() for eager loading:
      _context.Orders.Include(o => o.Items).ToListAsync()
  2. Missing indexes
    • Fix: Add indexes to frequently queried columns
  3. Large result sets
    • Fix: Implement pagination
      .Skip(page * size).Take(size)
  4. Connection pooling issues
    • Ensure DbContext is scoped (not singleton)

Section D: Intermittent Slowness

Possible Causes:

  1. Application Pool recycling
    • Check: Plesk → Application Pool settings
    • Review Private Memory Limit and recycling schedule
  2. Memory pressure
    • Symptom: Slow after running a while
    • Fix: Check for memory leaks, increase memory limit
  3. Garbage collection
    • Large object allocations cause GC pauses
    • Fix: Use ArrayPool, reduce allocations

Quick Wins Checklist

  • ☐ Enable Response Compression
  • ☐ Enable Output Caching
  • ☐ Set logging to Warning level
  • ☐ Use async/await everywhere
  • ☐ Bundle and minify static files
  • ☐ Add database indexes
  • ☐ Implement pagination
  • ☐ Review Application Pool memory limits

Was this answer helpful?

« Back