Knowledge Base

Performance Optimization

Performance Optimization

Optimizing sync performance for large databases and high-volume operations.

Large Initial Sync

For databases with thousands of records:

Use Skip Historical

  1. Go to Manual Sync
  2. Set a date (e.g., start of current year)
  3. Select contacts, invoices, and payments
  4. Click Skip Historical
  5. Only sync recent data going forward

Sync in Stages

  1. Sync contacts first (batch of 500)
  2. Wait for completion
  3. Sync invoices next
  4. Finally sync payments

Off-Peak Hours

  • Run large syncs outside business hours
  • Reduces impact on Xero rate limits
  • Faster processing when less API competition

API Rate Limits

Xero enforces rate limits:

  • Per-minute call limits
  • Daily call limits

The plugin handles this automatically:

  • Detects 429 (rate limit) responses
  • Waits and retries with exponential backoff
  • Batches contacts (50 per API call)

If you see many rate limit errors:

  • Reduce batch sizes
  • Spread sync over multiple sessions
  • Wait for daily limit reset (midnight UTC)

Cron Timeout Issues

If the cron task times out:

Increase PHP Limits

max_execution_time = 300
memory_limit = 256M

Process Smaller Batches

  • More frequent, smaller syncs
  • Let automatic sync handle ongoing operations
  • Use manual sync for catch-up in chunks

Check Server Resources

  • CPU usage during sync
  • Memory availability
  • Network latency to Xero API

Slow Queue Processing

If queue processes slowly:

Network Issues

  • Check latency to api.xero.com
  • Verify DNS resolution is fast
  • Consider if proxy/firewall adds delay

Server Load

  • Check server isn't overloaded
  • Verify adequate CPU/memory
  • Consider dedicated cron processing

Xero Status

  • Check status.xero.com for issues
  • API may be slow during Xero maintenance
  • Try again during off-peak hours

Batch Processing Tips

Contacts

  • Synced in batches of 50
  • ~10 API calls per 500 contacts
  • Most efficient entity type

Invoices

  • Synced individually
  • Each invoice = 1 API call
  • Most API-intensive operation

Payments

  • Synced individually
  • Requires invoice to exist first
  • Process after invoices complete

Monitoring Performance

Queue Page

Watch for:

  • Pending count decreasing each cron run
  • Failed items indicating issues
  • Processing speed patterns

Logs Page

Check for:

  • Rate limit errors (429)
  • Timeout errors
  • Consistent processing times

Automation Page

Verify:

  • Cron task running on schedule
  • Last run time is recent
  • No task failures
Please rate this article to help us improve our Knowledge Base.

0 0