Skip to main content
OwnPay is designed to run well on modest hardware, but as your transaction volume grows you can make targeted optimizations at each layer of the stack. This guide covers the most impactful changes.

Redis for sessions and cache

The single biggest performance improvement for most deployments is switching from file-based cache and sessions to Redis. Redis eliminates disk I/O for session reads, cache lookups, and rate limit tracking.
Use separate Redis databases for cache (DB 0) and queues (DB 1) if you want to flush the cache without losing queued jobs.

Database optimization

OwnPay’s schema uses MySQL Stored Generated Columns to avoid JSON extraction overhead on filtered queries. The existing composite indexes (idx_merchant_status, idx_merchant_created) handle most common query patterns.

Key configuration

Set innodb_buffer_pool_size to roughly 70% of available RAM dedicated to MySQL. On a server with 4 GB RAM and Redis, 1 GB is a reasonable starting point.
You can optimize tables from the admin panel under Settings > Database. This runs OPTIMIZE TABLE on all op_ tables to reclaim fragmented space.

PHP-FPM tuning

PHP-FPM worker configuration directly affects how many concurrent requests OwnPay can handle.
Also enable OPcache with JIT compilation in your php.ini:
Set opcache.validate_timestamps = 0 in production for maximum performance. After disabling it, you must restart PHP-FPM when updating OwnPay files.

Nginx configuration

Enable gzip compression and static asset caching in your Nginx server block:
For SSL, use a modern cipher suite and enable OCSP stapling. Nginx’s default SSL settings on most distributions are already reasonable, but you can test your configuration with SSL Labs.

CDN for static assets

If your brands use custom domains across different geographic regions, place a CDN (Cloudflare, Fastly) in front of the checkout domain. The CDN caches static assets (CSS, JS, images, fonts) and serves them from edge nodes closer to your customers.
Payment form submissions and webhook callbacks always hit your origin server directly. The CDN only caches static files.

Queue workers for async jobs

Background jobs (webhook deliveries, email sending, SMS processing, export generation) run through the queue system. When using Redis as the queue driver, process jobs with the cron endpoint:
For high-volume environments, run the queue worker as a dedicated long-running process instead of relying on the cron-based worker:

Scaling considerations

OwnPay’s PHP application is stateless when using Redis for sessions. This makes horizontal scaling straightforward - add more app servers behind your load balancer with no code changes.

Monitoring

Monitor these key metrics to know when to scale:
Last modified on August 25, 2026