apologies for the newbie nature of this question .. I am a web developer though don't have too much experience maintaining servers or debugging and fixing performance issues.
I have a Moodle site (Moodle 2.2.3) running on an Apache server (LAMP stack) that uses a MySQL database.
Recently, when certain users try to log in they have been reporting a timeout - they simply see a blank page after a given time. Some users are able to log in fine. This appears to be determined by which courses the user is enrolled in. An admin user with no courses for example can log in fine.
I have been able to extend the timeout value in php.ini from 60 seconds to 120 seconds and see the same behaviour. Using $top I can see that the CPU used by www-data spikes around 99% until the timeout kicks in.
I am assuming there is a long call to the database being made, or similar.
How can I see error messages logged by mysql? how can I see error messages logged by PHP? The default error_log (/var/log/php.log) which is defined in my php.ini doesn't appear to be there? How can I get PHP to log errors to this file so I can see whats happening?
Moodle also logs errors to logs/error.log but this doesn't shed any light on things.
All and any good suggestions welcome - thanks!