It was a difficult bug to track down because it seemed random. I became weary of the problem when popular topics became extremely unresponsive as well, but I didn't realize the issue until I tried to contact someone by email. Then it hit me. The reason most PMs and arbitrary topics are slow is because some members subscribe to topics, and many members have configured their accounts so they receive an email when they receive a PM. The system was slow because our email was slow. A quick search revealed the problem was likely an issue in our hosts file, because for some reason, the mail daemon expects to get "enigma-dev.org" out of hosts. So I changed our hostname in that file to
enigma-dev.org, and the problem was solved.