Wednesday, October 16, 2019

apache 2.2 - Where should I start to try and debug a CPU spike and timeout when logging in to a Moodle site?

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!

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...