This happens pretty regularly, but if there's a pattern to it I'm not sure I see it (I think it often happens the first time I've accessed the site in a while, but I'm not certain about that).
Even with only one person trying to access the site, it will grind to a complete halt for a minute or two, and then become perfectly normal. I've set up a script that runs iostat and vmstat whenever it detects the load average going above 1, and there doesn't appear to be any swapping going on. This plus the fact that when it's not completely stopped performance is fine leads me to thing it's a software problem rather than a hardware problem.
I do have some custom modules included, but they're things like a custom authentication module that would be a problem to just disable, so what I would really like is something that can profile moodle and report back which modules are responsible for the most work. Does such a thing exist? Any other advice for how to deal with this?
It may be worth noting that I'm running an old version (2.2) on a shared VM (though I don't think another VM could cause the CPU usage to skyrocket on mine?), and am in the process of upgrading and moving to a dedicated VM, but that's going to take some time, and I'd really like to figure out what's going on here.