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(R) 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.

Ahmet

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; https://www.aerospike.com/docs/operations/install/vagrant/win/using-vagrant.html

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/asd.pid
#       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
                multicast-group 239.1.99.222
                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 10.1.1.1
#               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)
    true
  end
end


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


# 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"
    config.vm.box = "aerospike-vm"
    config.vm.network "forwarded_port", guest: 3000, host: 3000 , auto_correct: true
    config.vm.network "forwarded_port", guest: 8081, host: 8081 , auto_correct: true 
    config.vm.network "private_network", type: :dhcp 
    config.ssh.insert_key = false
    config.vm.box_download_insecure = true
    # config.vm.network "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]
#    config.vm.network "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"]
    end

    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"
    end

    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"
    end
end

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 10.0.2.15)

1 Like

image

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:

asadm

then type

show latency

or

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

config.vm.network "private_network", ip: "1.1.1.200"

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;

image

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?;

config.vm.network “private_network”, ip: “1.1.1.200”