Improving Performance
Date: 07-05-2007 14:53 Views: 5305
Filesystem Caching of Templates
The biggest thing you can do is switch to using the filesystem for caching templates rather than the database. This is reasonably straightforward if you have server access.
1. Create a directory in a non-web accessible area that can be written to by the web server and call it something sensible such as 'templatecache'
2. In Site > Site Admin > Site Settings find the Template Source and change it to Filesystem then find Template Path and put in the full server path of the folder you created
Save these settings and test your site - this should significantly reduce database load.
CRON Schedule Processing
By default, MonkeyCMS checks to see if any content should be 'uploaded' to the main site on every visit to the page - this is fine for low-traffic sites, but for bigger sites it is sensible to avoid this overhead and reduce the number of queries on each page visit.
Therefore, it is possible to configure MonkeyCMS to run these checks via CRON on Linux and Scheduled Tasks on Windows.
There are a number of scripts that can be CRON scheduled. This particular post focusses on CRON scheduling of the processschedule.php script in your admincp folder.
Before proceeding, it may be worth reading up on CRON elsewhere.
To schedule the processschedule.php script at 10 minute intervals you should edit your CRON table to include:
0-50/10 * * * * /path/to/yoursite/admincp/processschedule.php
In your MonkeyCMS control panel go to Site > Site Admin > Site Settings and in the Scheduling options change the Schedule Type from Real Time to CRON.
The biggest thing you can do is switch to using the filesystem for caching templates rather than the database. This is reasonably straightforward if you have server access.
1. Create a directory in a non-web accessible area that can be written to by the web server and call it something sensible such as 'templatecache'
2. In Site > Site Admin > Site Settings find the Template Source and change it to Filesystem then find Template Path and put in the full server path of the folder you created
Save these settings and test your site - this should significantly reduce database load.
CRON Schedule Processing
By default, MonkeyCMS checks to see if any content should be 'uploaded' to the main site on every visit to the page - this is fine for low-traffic sites, but for bigger sites it is sensible to avoid this overhead and reduce the number of queries on each page visit.
Therefore, it is possible to configure MonkeyCMS to run these checks via CRON on Linux and Scheduled Tasks on Windows.
There are a number of scripts that can be CRON scheduled. This particular post focusses on CRON scheduling of the processschedule.php script in your admincp folder.
Before proceeding, it may be worth reading up on CRON elsewhere.
To schedule the processschedule.php script at 10 minute intervals you should edit your CRON table to include:
0-50/10 * * * * /path/to/yoursite/admincp/processschedule.php
In your MonkeyCMS control panel go to Site > Site Admin > Site Settings and in the Scheduling options change the Schedule Type from Real Time to CRON.

