In my production Environment I'm observing a sporadic issue where pages are taking a long time to load. In the error logs we are seeing:
PHP Fatal error: Maximum execution time of 30 seconds exceeded
The affected line is where a session is being created for the user.
The directories are physical. There are +3.5 million files in the directory. The trash collection is set for 31 days for sessions in PHP.
The issue is sporadic so I can't trigger it. The behavior is consistent that it is always the session starting that takes above 30 seconds to execute. The lines prior to that run fine, if I list the contents of the sessions directory (ls /var/www/sessions/) it takes +45 seconds just from the command line. I think application monitoring would be good but this seems to be an issue at the system level.
I've looked at the cloudwatch metrics but don't see a bottleneck involving the disc reads there.
Could anyone advise on what issues we might be running into and how to resolve them?