What are the hardware requirements to deploy mid-size trino cluster?

What are the hardware requirements to deploy mid-size trino cluster?
Example: I want deploy 7 node cluster. 2 for coordinators and 5 for workers.

Do we need any below items?
shared storage between nodes
Special storage like SSD
Any special network requirement (Ethernet)

What are the factors to calculate cpu/memory/storage?


Min 32GB RAM for co-ordinator (a r5.xlarge on AWS)
Min 64GB RAM for workers (a m5.4xlarge on AWS)

Co-ordinators are generally memory intensive. Workers need both memory and CPU.
Network must be fast - so all nodes in same subnet/availability-zones. 10Gb network interfaces are standard in the cloud and usually sufficient.
Trino doesn’t use disk (unless spilling is enabled) so only enough space needed for OS, Trino installation and logs. 50GB generally seems to be enough.

So for a starting point you can start with maybe:

Co-ordinator: 1 x r5.xlarge (4 core, 32GB RAM)
Workers: 5 x m5.4xlarge (16 core, 64GB RAM)

That gives you a total of little over 200GB of memory (it’s good practice to only allocate ~70% of memory to Trino’s JVM) which should be sufficient for starting out with production workloads.

You can then proceed to run two types of queries:

  1. Those which scan a lot of data or do joins
  2. Those which are complex (have lots of aggregations/window function etc.)

You can then keep adding more workers (or removing) until your queries stop failing and finish in an acceptable time limit. That will give you a baseline for the minimum cluster size you’ll need.

From there you can proceed to perform tests with concurrent queries in a more production like setting - that should allow you to see if the co-ordinator needs to be scaled up or not.

Note that it’s generally preferrable to use larger machines for workers since each Trino worker has a fixed memory overhead and having lesser number of larger machines reduces the amount of overhead. However try to keep your worker’s JVM heap under 256GB - JVM doesn’t handle very large heaps well at-least in JDK 11.

You should also take a look at this awesome video training by Dain, one of the creators of Trino itself - Starburst training series, session 4: Tuning Starburst and Trino Performance - YouTube

It talks about everything in more detail and depth and will help you build intuition and reason about when to increase number of nodes vs use larger nodes etc.