I have two machines:
Machine #1:
- Desktop
- Intel E5200 CPU (2.5Ghz)
- 2GB RAM (DDR2)
- Spinning hard drive (OS) and SSD Hard drive (data)
Machine #2:
- Laptop
- AMD E-300 (1.3GHz) CPU
- 8GB RAM (DDR3)
- Spinning hard drive
Both machines are running Ubuntu 11 and Postgres 9.1.
I have a large Postgres database (>100GB) and am running an advanced query. As I watch the query, all I see is 100% CPU on both machines..only one core seems to be used. iotop
shows very little hard drive activity (maybe 1MB/s bursts).
Machine #1 finishes in 20 minutes. Machine #2 is still running after 5 hours. I figured that Machine #2 would be about half the speed of Machine #1 (1.3Ghz vs 2.5 Ghz)..maybe a little better due to more RAM.
I ran this as a quick test to see if buying more RAM would make a huge difference on Machine #1, but it seems that CPU plays a much bigger role. Am I right or is there something else going on?
A few questions:
- What factors on Machine #2 are making it so slow?
- Could it be that the SSD is making a huge difference but I can't see it in iotop?
- Given a limited budget..which upgrades could I do to Machine #2 to make it even faster? In particular is RAM or CPU a better investment?