Forum Moderators: coopster
I run the script locally on my machine under apache and watch the CPU usage and it's fine.
Is there anything I can do to see if my script really is as bad as my host seems to reckon, could my host be mistaken it's my script that's at fault and pushing the memory and CPU up, or what can I do?
Thanks
One thing to watch out for is using an include() in a loop when you should be using a function. It eats memory. One way to help you monitor where and when you are having issues is a simple plug-in of the PHP memory_get_usage [php.net] function. Follow the link for usage examples.
I tried creating a test file with my template and the memory_get_usage function but alas that didnt work ( Fatal error: Call to undefined function: memory_get_usage() )
Are there any other ways of seeing just how bad my script apparently is?
Sorry if I'm missing something obvious, I apreciate the help.
memory_get_usage() will only be defined if your PHP is compiled with the --enable-memory-limit configuration option.
I would follow lorax's advice here. If you don't have a test server setup, you may want to so you can compile in the functions and features that you want to use. Benchmark on your system to see what and where issues may be.
Installing a new web server: Apache2, PHP5, MySQL4 and PHPmyAdmin [webmasterworld.com]