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.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.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.php.ini:
Nginx configuration
Enable gzip compression and static asset caching in your Nginx server block: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: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:Related Pages
- Installation - Initial server setup and requirements
- Backup and Export - Backup procedures before scaling changes
- Rate Limiting - Configure rate limits for high-traffic deployments