How to improve this simple Write Speed Test (c#)

Hi, I am trying to make simple “write speed” tests on my local pc(sata ssd).

I am using c#. Here is how i am writing 100 000 records very simply; image

And this write operation takes 56 second. Am i missing something or this is best performance for my local pc ?

Maybe bulk insert?

You are only using a single thread to perform these ‘puts’ and the ‘puts’ are all synchronous. You could use more than one thread or use the async APIs.

1 Like

If you are using .NET Framework, there is an AerospikeDemo application that can run multi-threaded benchmarks for you.

1 Like

Thanks i will check that application.

I couln’t prove my self Aerospike is faster then Postgres(Bulk) on Insert operations. I have tried 100 000 records both(Aero and Postgres) takes around 10 second

Then I have tried 1 000 000 record Aerospike(Batch) / Postgres(Bulk) insert From C# app

Postgres was faster then Aerospike.

Is it normal ?

Could you forward the spec of the machine you are running on and the configuration of Aerospike?

Thanks for helping, I really want to find why

I am using; Processor: Intel® Core™ i7-4700MQ CPU @ 2.40GHz (8 CPUs), ~2.4GHz

Memory: 16384MB RAM

SSD Sata

By the way i am using vagrant VM in windows 10 machine here is some stats from aerospike dashboard

I am using IP adress of my vagrant VM (in my pc) Maybe its slow beacuse of this reason. “localhost:3000” is not working.

I can share my test code parts also; image

Keys and bins are simple strings.

For postgres iam also generating my entity and bulk insert.


Can you also share your aerospace.conf file with us?

Thanks Tibor

I didn’t found “aerospike.conf” file They say its in etc/aerospike/aerospike.conf path but i haven’t find such path.

I have follwed these steps to install;

can you try:

vagrant ssh

and from within the prompt type

cd /etc/aerospike/

and then

cat aerospike.conf

and post the output of the cat command to this thread.

1 Like
# Aerospike database configuration file.

# This stanza must come first.
service {
        user root
        group root
        paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
        pidfile /var/run/aerospike/
#       service-threads 4
#       transaction-queues 4
#       transaction-threads-per-queue 4
        proto-fd-max 15000
        node-id-interface eth1

logging {
        # Log file must be an absolute path.
        file /var/log/aerospike/aerospike.log {
                context any info
        file /var/log/aerospike/udf.log {
                context udf info
                context aggr info

network {
        service {
                address eth1
                port 3000
#                access-address <Published IP>
#                access-address <NAT IP>

        heartbeat {
                mode multicast
                address eth1
                port 9918
                protocol v3

                # To use unicast-mesh heartbeats, comment out the 3 lines above and
                # use the following 4 lines instead.
#               mode mesh
#               port 3002
#               mesh-address
#               mesh-port 3002

                interval 150
                timeout 10

        fabric {
                port 3001
                address eth1

        info {
                port 3003

#namespace test {
#       replication-factor 2
#       memory-size 4G
#       default-ttl 30d # 30 days, use 0 to never expire/evict.
#       storage-engine memory

namespace test {
        replication-factor 2
        memory-size 2G
        default-ttl 5d # 5 days, use 0 to never expire/evict.

        # To use file storage backing, comment out the line above and use the
        # following lines instead.
        storage-engine device {
                file /opt/aerospike/data/test.dat
                filesize 5G
                data-in-memory true # Store data in memory in addition to file.

Here is my vagrant file;

# The contents below were provided by the Packer Vagrant post-processor
class VagrantPlugins::ProviderVirtualBox::Action::Network
  def dhcp_server_matches_config?(dhcp_server, config)

Vagrant.configure("2") do |config|
  config.vm.base_mac = "0800278AA558"

# The contents below (if any) are custom contents provided by the
# Packer template during image build. 
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
    config.vm.define "vagrant-as" = "aerospike-vm" "forwarded_port", guest: 3000, host: 3000 , auto_correct: true "forwarded_port", guest: 8081, host: 8081 , auto_correct: true "private_network", type: :dhcp 
    config.ssh.insert_key = false
    config.vm.box_download_insecure = true
    # "private_network", type: "dhcp", virtualbox__intnet: "name"
    #  virtualbox__intnet: true
    # Berkshelf
    # config.berkshelf.enabled = true
    # Shell - Hello World
    # config.vm.provision :shell, :inline => "C:\\vagrant\\scripts\\HelloWorld.bat"
    config.vm.provider :virtualbox do |v, override|
        v.gui = false
        v.customize ["modifyvm", :id, "--memory", 2048]
        v.customize ["modifyvm", :id, "--cpus", 2]
# "private_network", :type => 'dhcp', :name => 'vboxnet0', :adapter => 2
#        v.customize ["modifyvm", :id, "--vram", "256"]
#        v.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"]
#        v.customize ["setextradata", :id, "CustomVideoMode1", "1024x768x32"]
#        v.customize ["modifyvm", :id, "--ioapic", "on"]
#        v.customize ["modifyvm", :id, "--rtcuseutc", "on"]
#        v.customize ["modifyvm", :id, "--accelerate3d", "on"]
#        v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]

    config.vm.provider :vmware_fusion do |v, override|
        v.gui = false
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
        v.vmx["cpuid.coresPerSocket"] = "1"
#        v.vmx["ethernet0.virtualDev"] = "vmxnet3"
#        v.vmx["scsi0.virtualDev"] = "lsilogic"

    config.vm.provider :vmware_workstation do |v, override|
        v.gui = false
        v.vmx["memsize"] = "2048"
        v.vmx["numvcpus"] = "2"
        v.vmx["cpuid.coresPerSocket"] = "1"
#        v.vmx["ethernet0.virtualDev"] = "vmxnet3"
#        v.vmx["scsi0.virtualDev"] = "lsilogic"

Can you also run the following command within your vagrant vm

asinfo -v service

This should give you the ip(s) address being sent back to your client. I want to confirm its one ip address and its the one you’ve been using for your client to connect. (and its not the NAT ip

1 Like


This ip adress i am using in c# app.

that is weird. Try monitoring latency while you run your test.

from within the vm run asadm by typing:


then type

show latency


watch show latency

Is this a one node cluster? to rule out an issue with the dhcp assigned IP address you could create a second interface in your vagrantfile "private_network", ip: ""

modify you address binding in aerospike.conf to use eth2 instead of eth1. and use that ip address in your application.

1 Like

I thing yes, one node cluster;

Here is my result;


I am getting this log warnings in my app also.

I didn’t understand your mentioned modification; here is my vagrant file;

Should i replace 25 th line with this?; “private_network”, ip: “”

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.