Thread: Seeking Insights on Choosing the Right CPU and RAM for PostgreSQL Setup

Seeking Insights on Choosing the Right CPU and RAM for PostgreSQL Setup

From
Veerendra Pulapa
Date:

Dear PostgreSQL Community,


I hope you’re all doing well. We’re currently evaluating hardware options for our PostgreSQL setup, specifically focusing on CPU and RAM. We’d love to hear your insights on the following:


CPU:

  • Optimal number of cores?
  • Impact of clock speed?
  • Preferred CPU architectures?
RAM:

  • Recommended amount?
  • Importance of memory bandwidth?
  • Buffer cache configuration tips?


Any advice or experiences you can share would be greatly appreciated. Your input will help us make informed decisions and optimize our setup.


Thank you!


Br,
Veerendra Pulapa | Technical Consultant
M: +91-9949349894 | www.ashnik.com


            


______________________________________________________________________________________
This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s). If you are not the rightful recipient of this email, please delete this email immediately and inform the recipient. 

Hi Veerendra,

It depends on your database size, kind of queries, concurrent users etc. BTW, your question is too generic.

Regards,
Muhammad Ikram


On Thu, Jul 18, 2024 at 8:34 PM Veerendra Pulapa <veerendra.pulapa@ashnik.com> wrote:

Dear PostgreSQL Community,


I hope you’re all doing well. We’re currently evaluating hardware options for our PostgreSQL setup, specifically focusing on CPU and RAM. We’d love to hear your insights on the following:


CPU:

  • Optimal number of cores?
  • Impact of clock speed?
  • Preferred CPU architectures?
RAM:

  • Recommended amount?
  • Importance of memory bandwidth?
  • Buffer cache configuration tips?


Any advice or experiences you can share would be greatly appreciated. Your input will help us make informed decisions and optimize our setup.


Thank you!


Br,
Veerendra Pulapa | Technical Consultant
M: +91-9949349894 | www.ashnik.com


            


______________________________________________________________________________________
This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s). If you are not the rightful recipient of this email, please delete this email immediately and inform the recipient. 



--
Muhammad Ikram

On 18/07/2024 16:33, Veerendra Pulapa wrote:

Dear PostgreSQL Community,


I hope you’re all doing well. We’re currently evaluating hardware options for our PostgreSQL setup, specifically focusing on CPU and RAM. We’d love to hear your insights on the following:


Without knowing the details of the workload and data etc, it's pretty much impossible to say.

A 1 core CPU at 1.5GHz with 2GB of RAM will happily run PostgreSQL, but may not be able to run it at your desired speed with your workload.

Conversely 256 cores at 3GHz with 1TB of RAM will also happily run PostgreSQL, but may be overkill.


Also, from experience, disk system is at least as important as CPU/RAM (until you get to the point where the RAM will hold the whole database in cache). Running a fast CPU with lots of RAM won't be any use if you're running it on 5400 RPM SATA drives in a RAID 5 array....


Paul


On Thu, 2024-07-18 at 21:03 +0530, Veerendra Pulapa wrote:
> I hope you’re all doing well. We’re currently evaluating hardware options for our
> PostgreSQL setup, specifically focusing on CPU and RAM. We’d love to hear your insights
> on the following:
>
> CPU:
>  * Optimal number of cores?
>  * Impact of clock speed?
>  * Preferred CPU architectures?
> RAM:
>  * Recommended amount?
>  * Importance of memory bandwidth?
>  * Buffer cache configuration tips?
>
> Any advice or experiences you can share would be greatly appreciated. Your input will
> help us make informed decisions and optimize our setup.

How big is the database going to be?
How many transactions per second do you expect?
How many concurrent statements will you have to handle?
What kind of workload is it going to be? OLTP? Analytical? Mixed?

Yours,
Laurenz Albe



Hi Veerendra,

I will suggest

SSD storage 2 to 3 times bigger than your database to account for growth. Vacuum etc specially if Tables are very big or expected to grow fast. For high TPS 32 cores or more processors.
Memory 128 Gig or more. More memory is better to keep active dataset  in memory to avoid excessive I/O.

Regards,
Muhammad Ikram





On Thu, Jul 18, 2024 at 8:52 PM Veerendra Pulapa <veerendra.pulapa@ashnik.com> wrote:
Hi Muhammad,

Yes, the previous email was generic without specific details. However, I would appreciate guidance on sizing based on the following specifics:


1. Database size: Approximately 5TB.

2. Current TPS (Transactions Per Second): 1000-1500 TPS.

3. Read-write ratio: 60-40%.

4. Configuration: It’s a three-node setup.

5. Concurrent users: Typically between 300-350.



Br,
Veerendra Pulapa | Technical Consultant
M: +91-9949349894 | www.ashnik.com


            



On Thu, Jul 18, 2024 at 9:10 PM Muhammad Ikram <mmikram@gmail.com> wrote:
Hi Veerendra,

It depends on your database size, kind of queries, concurrent users etc. BTW, your question is too generic.

Regards,
Muhammad Ikram


On Thu, Jul 18, 2024 at 8:34 PM Veerendra Pulapa <veerendra.pulapa@ashnik.com> wrote:

Dear PostgreSQL Community,


I hope you’re all doing well. We’re currently evaluating hardware options for our PostgreSQL setup, specifically focusing on CPU and RAM. We’d love to hear your insights on the following:


CPU:

  • Optimal number of cores?
  • Impact of clock speed?
  • Preferred CPU architectures?
RAM:

  • Recommended amount?
  • Importance of memory bandwidth?
  • Buffer cache configuration tips?


Any advice or experiences you can share would be greatly appreciated. Your input will help us make informed decisions and optimize our setup.


Thank you!


Br,
Veerendra Pulapa | Technical Consultant
M: +91-9949349894 | www.ashnik.com


            


______________________________________________________________________________________
This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s). If you are not the rightful recipient of this email, please delete this email immediately and inform the recipient. 



--
Muhammad Ikram


______________________________________________________________________________________
This email may contain confidential, privileged or copyright material and is solely for the use of the intended recipient(s). If you are not the rightful recipient of this email, please delete this email immediately and inform the recipient. 



--
Muhammad Ikram

Veerendra Pulapa wrote:

> We’re currently evaluating hardware options for our PostgreSQL setup,
> specifically focusing on CPU and RAM.
>
> Yes, the previous email was generic without specific details. However,
> I would appreciate guidance on sizing based on the following specifics:
>
>     1.    Database size: Approximately 5TB.
>     2.    Current TPS (Transactions Per Second): 1000-1500 TPS.
>     3.    Read-write ratio: 60-40%.
>     4.    Configuration: It’s a three-node setup.
>     5.    Concurrent users: Typically between 300-350.

The concurrent users are not so relevant, but the expected number of
concurrent SQL statements is.  That determines how many CPU cores you need.

With many transaction, you mostly need powerful, fast storage.

The answer to RAM is always: the more, the better.  It is impossible to
be certain, but going lower than 64 or 128 GB is probably not a good idea.

You are speaking of "current TPS", which sound like you already have a
system running, perhaps with a different database system.  That's useful:
if you are currently happy with the performance, size the PostgreSQL machine
similarly.

Yours,
Laurenz Albe



That's a heck of a lot of waste on a multi-TB DB in a VM+SAN environment, where lots of other systems want their resources too (even with over-provisioning and data-duplication).

On Thu, Jul 18, 2024 at 12:10 PM Muhammad Ikram <mmikram@gmail.com> wrote:
Hi Veerendra,

I will suggest

SSD storage 2 to 3 times bigger than your database to account for growth.