Multiple instances on the same server


Dear Team,

We want to run multiple instances on the same server. Please suggest the required configuration changes for this operation. Now we are using the community version of aerospike.

Thanks Sumit Thakur


Why would you want to run multiple instances on the same server?


I want to get more throughput by using single hardware machine. It can be reduce deployment cost in production. Please suggest if you have better idea.


First, Aerospike isn’t Redis, which runs on a single core. The asd daemon will expand to use all the cores on your box automatically. It’s designed to use the hardware resources efficiently. Theoretically you can run multiple instances on a physical machine using something like Docker or virtual machines, but be aware that each layer of virtualization adds overhead that takes away from your machine’s real capacity. Bare metal deployments are going to use the resources of that machine better.

Second, a single physical machine is a single point of failure. It doesn’t matter if you run 3 instances of Aerospike on that single machine - if the power supply gives out, or a drive fails, or the NIC malfunctions all 3 will be affected. Aerospike is a distributed database, and it allows you to very easily form a cluster over multiple machines. You should deploy over multiple machines (typically 3 or more) to be more resilient.




Thanks, Ronen


I run multiple instance per server in our environment. To do it properly requires a few configuration changes in both Aerospike configs and network configs (especially if you wish to use the auto-pin NUMA or CPU options). I would never run it in docker on bare metal – not when it is capable of running multiple instances natively.

As was pointed out though, you’ll want to run multiple servers to avoid any potential downtime or data loss. I run 3 servers, 6 total instances (2 per) using NUMA auto pinning. This has served us extremely well for the many months I’ve had the cluster in service.


What is the advantage of running 2 instances per server? Why not just one?


As @Kargh pointed out, the only time it makes any sense to run multiple instances on a single physical machine is to take advantage of pinning to the same NUMA node. This must be used in conjunction with rack awareness, so it’s a bit difficult to set up. You do get a very big performance boost, especially for in-memory namespaces on multi-core systems.

The What’s New in Aerospike 3.12 blog post goes over auto-pinning to CPU and NUMA.


I run 2 per for two reasons. First, the servers I’m using are extremely powerful and it doesn’t make sense to let all the CPU sit idle. Second is because of NUMA. With 2 CPUs and 2 NICs, I can pretty much segregate the two instances. The performance boost is pretty huge but it does take some non-standard configuration to make it work.


:+1: power user award.