Benchmark elxis
Debug database globally
Turn mosConfig_debug global configuration parameter to 1 to see all the database queries executed in any page.
Debug database internally
If you want to debug a certain database query used in your custom component, module or bot you can start Elxis debugger on runtime.
//to start the debugger
$database->_resource->debug = true;
//to stop the debugger
$database->_resource->debug = false;
Benchmark (speed test)
Elxis 2008 allows you to check any code block for speed. The idea behind this is to be able to check alternative coding style (especially for database queries) till you find the fastest one. Faster code means page loading time decrease and CPU/Mysql saving.
$tstart = microtime(); //starts counter
//code here that you want to check execution time
$dt = stopBenchmark($tstart, microtime());
//where $dt is the time taken (in msec) for the above code to be executed
Memory usage
To find the memory used by Elxis CMS or any code block (requires a trick here) you can use the memory_get_usage() PHP function. Go to index.php file or your template's index.php file and place at the end this line:
echo memory_get_usage();
The function above is not available on windows servers. See here for a Windows equivalent function of memory_get_usage.
Normally Elxis 2008.0, with the default installation, needs about 8MB of RAM.
You can reduce the memory needed by unpublish or remove unnecessary features and unset any variables you don't need in your custom extensions. Unset PHP function frees memory. If your php.ini file has too less memory allocated to PHP (i.e. 8MB) and your server has enough free memory increase the PHP memory.



