I have a 3-year-old G5 Mac with two 500G hard drives. Everything still works perfectly, except for two things: More and more, it goes through periods in which it sounds like a vacuum cleaner . . . then, just as mysteriously, the sound dies down. It also goes through periods in which everything happens more slowly than normal . . . this is especially noticeable if I’m on-line or if I’m typing. This can be temporarily fixed by restarting. These two symptoms don’t necessarily happen at the same time.
Almost certainly you have dust inside the case. Fans are variable speeds, and they worker harder when there is need for increased airflow. The CPU has temperature sensors, and if it detects overheating it will cut down clock speed, so you’ll see the performance problem.
The next thing that will happen is that it will shut down without warning.
Get some compressed air and blow out the dust. I don’t know how this machine is configured, but if you can get inside that will work also. If that doesn’t work it might be something else, but this is the most likely suspect, and cheapest to fix. I did this for a laptop, and the improvement was amazing.
Sounds like you already figured it out, but I’d just like to add, if it is caked with dust and you use compressed air to clean it, do it outside. All that dust blowing around can make quite a mess.