# Multiple instances on the same server

**URL:** <https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079>\
**Category:** General Discussion\
**Created:** [April 5, 2018, 5:14am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079 "2018-04-05T05:14:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumit\_Thakur](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/sumit_thakur/32/959_2.png) [@Sumit\_Thakur](https://discuss.aerospike.com/u/Sumit_Thakur)\
**Post date:** [April 5, 2018, 5:14am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/1 "2018-04-05T05:14:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 5, 2018, 5:33am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/2 "2018-04-05T05:33:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sumit\_Thakur](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/sumit_thakur/32/959_2.png) [@Sumit\_Thakur](https://discuss.aerospike.com/u/Sumit_Thakur)\
**Post date:** [April 5, 2018, 6:29am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/3 "2018-04-05T06:29:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 5, 2018, 4:32pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/4 "2018-04-05T16:32:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [April 5, 2018, 10:53pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/5 "2018-04-05T22:53:25Z")

</div>

`s/automatically/automagically/Ig`

---

<div class="post-metadata">

**Author:** ![Sumit\_Thakur](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/sumit_thakur/32/959_2.png) [@Sumit\_Thakur](https://discuss.aerospike.com/u/Sumit_Thakur)\
**Post date:** [April 6, 2018, 4:35am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/6 "2018-04-06T04:35:31Z")

</div>

Thanks, Ronen

---

<div class="post-metadata">

**Author:** ![Kargh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kargh/32/906_2.png) [@Kargh](https://discuss.aerospike.com/u/Kargh)\
**Post date:** [April 12, 2018, 2:49pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/7 "2018-04-12T14:49:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [April 12, 2018, 2:59pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/8 "2018-04-12T14:59:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 12, 2018, 7:50pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/9 "2018-04-12T19:50:54Z")

</div>

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](https://www.aerospike.com/docs/reference/configuration#auto-pin) to the same NUMA node. This must be used in conjunction with [rack awareness](https://www.aerospike.com/docs/operations/configure/network/rack-aware/index.html), 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](https://www.aerospike.com/blog/whats-new-aerospike-3-12/) blog post goes over auto-pinning to CPU and NUMA.

---

<div class="post-metadata">

**Author:** ![Kargh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kargh/32/906_2.png) [@Kargh](https://discuss.aerospike.com/u/Kargh)\
**Post date:** [April 12, 2018, 10:56pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/10 "2018-04-12T22:56:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [April 12, 2018, 11:21pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/11 "2018-04-12T23:21:24Z")

</div>

👍 power user award.

---

<div class="post-metadata">

**Author:** ![Ankur\_Mukherjee](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/ankur_mukherjee/32/1816_2.png) [@Ankur\_Mukherjee](https://discuss.aerospike.com/u/Ankur_Mukherjee)\
**Post date:** [February 18, 2022, 11:18am UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/12 "2022-02-18T11:18:59Z")

</div>

Hi Kargh,

Can you kindly provide me the steps you took to setup and configure running of multiple instances on a single machine for the Aerospike DB? I could not find any related materials out there to get this done.

Regards, Ankur

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [February 18, 2022, 8:48pm UTC](https://discuss.aerospike.com/t/multiple-instances-on-the-same-server/5079/13 "2022-02-18T20:48:06Z")

</div>

Do you want to run multiple, say 3, aerospike services on a systemd distro, on same physical machine, without using containers? Is that what you are trying to achieve?
