by loftar » Wed Aug 12, 2009 5:57 pm
Well, at least I seem to have found out now why gprof didn't work on the server. I'll do a shutdown sometime again and try to profile it. Hopefully, that will let me optimize its CPU usage as much as I'd like.
(The technical explanation why gprof didn't work, for anyone interested, is because it uses setitimer(2) on Linux to do its statistical time profile, and it seems that such timers do not carry over forks, so the profiling stopped as soon as the server daemonized. Hacking in a call to __monstart, which restarts the timer manually, seems to fix the problem.)
Though, the CPU usage problem is by far the smallest. The largest problems are, as I stated previously, the account database and Apache. I've found an old computer of mine that I think we'll try to transfer Apache to during our next dev session, and I'll have to take a brawl with the account server.
"Object-oriented design is the roman numerals of computing." -- Rob Pike