System Administration

System Administration

SystemAdministration Performance Optimization CronJobs

Available in:

System Administration Overview

Effective system administration is essential for maintaining a high-performance affiliate program . Post Affiliate Pro provides comprehensive tools for managing scheduled tasks, caching, logging, database optimization, and system maintenance. Understanding these features helps ensure your affiliate software runs smoothly and efficiently.

Scheduled Tasks and Cron Jobs

How Cron Jobs Work

Post Affiliate Pro uses a task scheduling system that processes background jobs automatically. The main entry point is the jobs.php script, which should be called regularly by your server’s cron daemon.

The task runner executes pending tasks within a configurable time frame, typically running for the duration of the cron interval minus a small buffer. Tasks that cannot complete in one execution cycle are automatically resumed in the next run.

Setting Up Cron Jobs

To configure cron jobs for your installation:

  1. Access your server via SSH or your hosting control panel
  2. Add a cron entry to run the jobs script:
* * * * * /usr/local/bin/php -q /path/to/your/installation/scripts/jobs.php

This runs the task processor every minute, which is the recommended configuration. The system automatically calculates how long each execution should run based on your configured cron interval.

Cron Configuration Options

In the merchant panel under Tools, you can configure:

  • Cron run interval - How often your cron job runs (default: 1 minute)
  • Parallel job count - Number of concurrent task workers for high-traffic installations

The system monitors cron execution and displays a warning if tasks have not been processed recently. You can also manually trigger task execution from the admin panel for testing purposes.

Task Inclusion and Exclusion

For advanced configurations, you can run specific tasks or exclude certain tasks:

php jobs.php --include TaskClassName1 TaskClassName2
php jobs.php --exclude TaskClassName1 TaskClassName2

This is useful for distributing workload across multiple cron workers or isolating problematic tasks.

Cache Management

Caching System

Post Affiliate Pro utilizes Redis for high-performance caching, which significantly improves response times for frequently accessed data. The caching system stores:

  • User session data
  • Configuration settings
  • Affiliate and campaign data for tracking
  • Visitor affiliate associations

Cache Configuration

Cache settings are defined in your installation’s configuration file. The system supports:

  • Cache Redis hosts - Redis server addresses for caching
  • Tracking Redis hosts - Separate Redis configuration for tracking data
  • Port configuration - Custom port settings for Redis connections

Cache Clearing

When making configuration changes or troubleshooting issues, you may need to clear cached data. The system provides options for:

  • Clearing specific cache entries
  • Flushing the entire cache
  • Automatic cache invalidation when settings change

For tracking-related caches like direct links and mod rewrite settings, clear the cache after making configuration changes to ensure new settings take effect immediately.

Debug Logging Configuration

Log Levels

Post Affiliate Pro provides configurable logging to help diagnose issues. Available log levels include:

  • Error (40) - Critical errors only (default)
  • Warning (30) - Errors and warnings
  • Info (20) - General information messages
  • Debug (10) - Detailed debugging information

Higher verbosity levels generate more log entries, which can impact performance. Use debug logging only when troubleshooting specific issues.

Debug Mode

For detailed tracking diagnostics, you can enable debug mode which logs:

  • Click and impression processing details
  • Sale and lead tracking information
  • API request details
  • Error conditions and their context

Debug mode automatically disables after one hour to prevent performance degradation and log file growth. The debug types setting allows you to specify which categories of events to log (e.g., actions, banners, errors).

Event Log Management

The system automatically cleans up old event log entries based on your configuration:

  • Delete events after X days - Remove log entries older than specified days (default: 7 days)
  • Maximum event records - Keep only the specified number of most recent records (default: 500,000)

These settings help maintain database performance while retaining sufficient historical data for troubleshooting.

Login History Cleanup

Login history records are automatically purged after a configurable number of days (default: 30 days). This helps maintain database size while preserving recent security audit information.

Maintenance Mode

Understanding Maintenance Mode

Maintenance mode temporarily suspends normal application operations during upgrades or critical maintenance. When enabled:

  • Task processing is paused
  • API requests return HTTP 503 (Service Unavailable)
  • Users see a maintenance notification
  • Tracking continues to queue data for later processing

Exempt Endpoints

Certain endpoints remain accessible during maintenance:

  • Health check endpoints (/health, /health-check)
  • Documentation endpoints
  • OpenAPI specification

This allows monitoring systems to verify the application status even during maintenance windows.

Automatic Maintenance

The system enters maintenance mode automatically during:

  • Version upgrades
  • Database migrations
  • License revalidation

Once the maintenance operation completes, normal operation resumes automatically.

Database Status and Optimization

Database Status Plugin

The Database Status plugin provides visibility into your database health. After activation, navigate to Tools > Database Status to view:

  • Table names and sizes
  • Row counts for each table
  • Index information
  • Storage engine details

Database Operations

The plugin supports several maintenance operations:

  • Analyze Table - Updates table statistics for query optimization
  • Optimize Table - Defragments tables and reclaims unused space
  • Repair Table - Fixes corrupted table structures

Run these operations during low-traffic periods as they may temporarily lock tables.

Plugin Requirements

The Database Status plugin requires your database user to have SELECT privileges on the INFORMATION_SCHEMA.TABLES system table. If activation fails, verify these permissions with your database administrator.

Automatic Data Cleanup

Post Affiliate Pro automatically manages data retention for optimal performance:

  • Raw clicks - Deleted after configurable days (default: 185 days)
  • Expired visitors - Cleaned up automatically
  • Visit and sale logs - Removed after specified days (default: 60 days)
  • Old mail records - Purged after configurable months (default: 2 months)

System Requirements

PHP Requirements

  • PHP 8.0 or higher
  • PDO MySQL extension
  • GD library (for captcha and image processing)
  • bcmath extension (for rate limiting algorithms)
  • hash extension with SHA-256 support
  • Standard PHP Library (SPL)
  • filter_var function enabled
  • Minimum 128MB memory limit

Required PHP Functions

The following functions must be enabled:

  • tempnam
  • mkdir
  • imagettftext
  • imagejpeg
  • base64_decode
  • mime_content_type

MySQL Requirements

  • MySQL 5.7 or higher (MySQL 8.0 recommended)
  • utf8mb4 character set
  • utf8mb4_unicode_ci collation
  • PDO MySQL driver

Session Configuration

  • session.auto_start must be disabled
  • session.save_path must be an absolute path (not relative)

File System

  • Configuration directory must be writable by the web server
  • Ability to create files and subdirectories within the accounts directory

Performance Tuning

Visit Processing

Optimize visit processing for your traffic volume:

  • Offline processing - Process visits asynchronously for high-traffic sites
  • Online sale processing - Enable for immediate commission tracking
  • Multi-processor workers - Configure up to 8 parallel workers for visits and impressions

Statistics Processing

The sales statistics processor consolidates transaction data at configurable intervals:

  • Processing interval - How often stats are recalculated (default: 15 minutes)
  • Hourly stats retention - Days to keep detailed hourly statistics
  • For impressions and clicks: default 365 days
  • For sales: default 180 days

Grid Performance

Configure data grid limits to balance usability with performance:

  • Row limit - Maximum rows returned in grids (default: 500)
  • Export limit - Maximum rows for CSV exports (default: 500)
  • Condition limit - Maximum filter conditions (default: 1000)

Email Throttling

Control email sending rates to avoid overwhelming mail servers:

  • Affiliate emails per minute - Limit bulk emails to affiliates (default: 30)
  • System emails per minute - Maximum automated notifications (default: 10)

Task Interruption

Configure task behavior for long-running operations:

  • Interruption sleep time - Pause between task segments
  • Maximum task run time - Timeout for stalled tasks (15 minutes)

Tasks automatically checkpoint their progress, allowing seamless resumption if interrupted.

Backup Considerations

What to Backup

A complete backup includes:

  1. MySQL Database

    • All Post Affiliate Pro tables
    • User data, transactions, and configurations
    • Campaign and banner information
  2. File System

    • Configuration files in the accounts directory
    • Uploaded banners and promotional materials
    • Custom themes and templates
    • Plugin configurations

Backup Best Practices

  • Schedule regular automated backups
  • Store backups in a separate location from your server
  • Test backup restoration periodically
  • Document your backup and recovery procedures
  • Consider point-in-time recovery for critical installations

Hosted Installations

For hosted Post Affiliate Pro installations, backups are managed automatically by the hosting infrastructure. Contact support for specific backup and restoration requests.

Security Considerations

IP Restrictions

Configure IP-based access controls for:

  • Admin panel logins
  • Affiliate signups
  • API access

Rate Limiting

Protect against abuse with configurable rate limits:

  • Login attempts per username/IP (default: 10 per hour)
  • Signup attempts (default: 10 per hour)
  • Contact form submissions (default: 10 per hour)

Session Security

  • Sessions expire after configurable timeout
  • Old sessions are automatically cleaned up
  • Redis-backed session storage for high availability

Monitoring and Troubleshooting

Health Checks

Monitor system health through:

  • Cron job execution status
  • Task queue depth
  • Database connection status
  • Cache availability

Common Issues

Cron not running:

  • Verify cron entry is correctly configured
  • Check PHP path is correct
  • Ensure scripts/jobs.php is executable

High database usage:

  • Enable automatic data cleanup
  • Run table optimization
  • Review slow query logs

Cache issues:

  • Verify Redis connectivity
  • Check Redis memory allocation
  • Clear cache and restart if needed

For additional troubleshooting assistance, access the support portal or contact technical support.

Frequently asked questions

What are the system requirements for Post Affiliate Pro?

Post Affiliate Pro requires PHP 8.0 or higher with PDO MySQL extension, GD library, bcmath extension, and at least 128MB memory limit. MySQL database with utf8mb4 character set is required. The configuration directory must be writable by the web server.

How do I set up cron jobs for Post Affiliate Pro?

Set up a cron job to run every minute with the command: /usr/local/bin/php -q /path/to/scripts/jobs.php. This ensures scheduled tasks like visit processing, email sending, and data cleanup run automatically.

How can I optimize database performance?

Use the Database Status plugin to analyze, optimize, and repair tables. Enable automatic cleanup of old raw clicks, event logs, and login history. Configure the sales statistics processor interval for your traffic volume.

What should I backup in Post Affiliate Pro?

Back up the MySQL database regularly, including all tables. Also backup the accounts directory containing configuration files, uploaded files, and custom themes. For hosted versions, backups are managed automatically.

Optimize Your Affiliate Program Performance

Take full control of your Post Affiliate Pro installation with powerful system administration tools. Ensure optimal performance and reliability.

Learn more

How Can Post Affiliate Pro Help Manage Affiliate Programs?
How Can Post Affiliate Pro Help Manage Affiliate Programs?

How Can Post Affiliate Pro Help Manage Affiliate Programs?

Discover how Post Affiliate Pro streamlines affiliate program management with advanced tracking, commission automation, fraud prevention, and comprehensive repo...

9 min read
How to Activate Plugins in Post Affiliate Pro
How to Activate Plugins in Post Affiliate Pro

How to Activate Plugins in Post Affiliate Pro

Learn how to activate plugins in Post Affiliate Pro with our step-by-step guide. Discover integration and customization plugins to enhance your affiliate progra...

6 min read
Affiliate Assignment & Automation Plugins
Affiliate Assignment & Automation Plugins

Affiliate Assignment & Automation Plugins

Automate affiliate assignments to campaigns and commission groups based on signup, products, or profile fields. Save time with Post Affiliate Pro's powerful aut...

8 min read
AffiliateMarketing Automation +3

You will be in Good Hands!

Join our community of happy clients and provide excellent customer support with Post Affiliate Pro.

Capterra
G2 Crowd
GetApp
Post Affiliate Pro Dashboard - Campaign Manager Interface