patternsqlMajor
Is the CPU performance relevant for a database server?
Viewed 0 times
thedatabaserelevantforperformanceservercpu
Problem
This is a purely theoretical question. Let's say I have an application deployed on multiple servers.
On the two first parts, I do know what to look for. But what about the database server? What kind of hardware should I look for?
PS: Supposing the chosen database is MySQL or PostgreSQL.
- A load balancer,
- Multiple/scalable applications servers
- A (single) database server (for the moment)
On the two first parts, I do know what to look for. But what about the database server? What kind of hardware should I look for?
- Is CPU frequency relevant for a database server?
- Are multiple core CPUs relevant?
- Is RAM more important than CPU?
PS: Supposing the chosen database is MySQL or PostgreSQL.
Solution
For PostgreSQL, CPU power can be very relevant, especially if a fairly high percentage of the active working set of your data fits in RAM. Most of the databases I've worked with have had CPU power as the main bottleneck most of the time. (I just checked vmstat on a server hosting web sites with millions of hits per day hosting over 5TB of database space, and I never saw more than 2% disk wait time, but saw a peak of 12% user CPU time.)
Since PostgreSQL is process-based, any single process can only run as fast as one core, but in a mix like like we have on the server mentioned above, with a high volume of small requests, total CPU across all cores is most important. For the same total CPU power, PostgreSQL will generally do better with fewer, faster cores than many, slower cores.
Up to the point where a high percentage of your active data set is cached, adding RAM will typically show more bang for the buck than adding cores. After you've got sufficient caching, the benefit of additional RAM goes down and you're better off boosting CPU power.
For more details on this topic as it pertains to PostgreSQL, I don't think there is a better source than PostgreSQL 9.0 High Performance by Greg Smith. (Full disclosure, I was a technical reviewer for the book, but get no financial benefit based on sales.)
Since PostgreSQL is process-based, any single process can only run as fast as one core, but in a mix like like we have on the server mentioned above, with a high volume of small requests, total CPU across all cores is most important. For the same total CPU power, PostgreSQL will generally do better with fewer, faster cores than many, slower cores.
Up to the point where a high percentage of your active data set is cached, adding RAM will typically show more bang for the buck than adding cores. After you've got sufficient caching, the benefit of additional RAM goes down and you're better off boosting CPU power.
For more details on this topic as it pertains to PostgreSQL, I don't think there is a better source than PostgreSQL 9.0 High Performance by Greg Smith. (Full disclosure, I was a technical reviewer for the book, but get no financial benefit based on sales.)
Context
StackExchange Database Administrators Q#17092, answer score: 31
Revisions (0)
No revisions yet.