Apple M2 Max Performance: Running a 500 Node Cluster with PM2

Ramit
2 min readMay 20, 2023

The Apple M2 Max is a powerful chip that can handle even the most demanding workloads. In this blog post, we will show you how to run a 500 node cluster with PM2 on an M2 Max MacBook Pro. Just for fun.

I wanted to test how the M2 Max performs if we try to run a 500 node cluster using PM2. Obviously, it is not something you would be doing on a regular basis. However, it’s fascinating to see that Apple M2 performs beautifully without breaking a sweat.

I wrote a simple NodeJS script for this demo that recursively deletes request logs from my PocketBase endpoint. Each node of this cluster will be performing this same action.

System information:
- Apple M2 Max with 12‑core CPU, 30‑core GPU and 16‑core Neural Engine
- 64GB unified memory

You can watch the demo here: https://youtu.be/QBgp5MdApKg

Here are some additional observations from the test:

  • Higher unified memory is helpful in working such heavy workloads.
  • There is a CPU spike when you start running the clusters, however, once they are up, the utilization goes down significantly. It goes to show that NodeJS on ARM chips is really efficient.
  • Battery drain was very negligible (please discount the GPU usage to the screen recording)
  • The only bottleneck was how many requests the PocketBase setup was able to handle at once and at times 500 nodes making requests to the backend caused timeouts (but it’s not a reflection on the cluster setup as my PocketBase setup is hosted elsewhere on the cloud).

Use cases:

While I did this mostly for fun, real applications might include running a cluster of nodes which make API calls to your backend to stress it out. Think of it like running a custom stress test. Or, like me, if you have millions of logs that you want to clear out, you can have a script file that does this activity and then run it on multiple nodes (this works well as long as your backend is able to handle all the incoming requests).

Summary:

Hope this was fun. If you want to watch the demo it’s here: https://youtu.be/QBgp5MdApKg

These results show that the Apple M2 Max chip is a very powerful chip that can handle even the most demanding workloads. It is clear that the M2 Max is a significant upgrade over the previous generation of Apple chips.

For developers, M2 Max chips are overkill, however, it’s great to see that it can run such heavy workloads and not break a sweat. Pretty sure if I was trying to do the same on a Windows laptop it would catch 🔥.

Thank you.

--

--

Ramit

Data Science & deep learning entusiast. Polyglot developer. Introvert. Minimalist.