Skip to content

Aerospike Benchmark (asbench)

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

The Aerospike Benchmark tool is a C-based tool that measures the performance of an Aerospike cluster. It can mimic real-world workloads with configurable record structures, access patterns, and UDF calls.

Install asbench on Linux with the aerospike-asbench package. See Install tools on Linux with a package manager.

Usage

The --help option of asbench gives an overview of all supported command line options. The -V or --version option prints the current version of asbench.

Terminal window
asbench --help

Connection options

OptionDefaultDescription
-h or --hosts HOST_1:TLSNAME_1:PORT_1[,...]127.0.0.1List of seed hosts. TLSNAME is only used when connecting with a secure TLS-enabled server. If the port is not specified, the default port is used. IPv6 addresses must be enclosed in square brackets.
-p or --port PORT3000Default port on which to connect to Aerospike.
-U or --user USERUser name. This is mandatory if security is enabled on the server.
-P [PASSWORD]User’s password for Aerospike servers that require authentication. Without a value, the system asks you to enter the password. Starting with Tools 13.2.0, the value can be env:VAR, env-b64:VAR, b64:VALUE, file:PATH, or secrets:.... See Password and secret sources.
--auth MODEINTERNALSet the authentication mode when user/password is defined. Replace MODE with one of the following: INTERNAL, EXTERNAL, EXTERNAL_INSECURE, or PKI. This mode must be set to EXTERNAL when using LDAP.
-tls or --tls-enabledisabledUse TLS/SSL sockets.
--services-alternatefalseUse to connect to alternate-access-address when the cluster nodes publish IP addresses through access-address which are not accessible over WAN, or to connect to alternate IP addresses accessible over WAN through alternate-access-address.

TLS options

OptionDefaultDescription
--tls-cafile=TLS_CAFILEPath to a trusted CA certificate file.
--tls-capath=TLS_CAPATHPath to a directory of trusted CA certificates.
--tls-name=TLS_NAMEDefault TLS name used to authenticate each TLS socket connection. This must match the cluster name.
--tls-protocols=TLS_PROTOCOLS-all +TLSv1.2 if the connection supports TLSv1.2. -all +TLSv1 if it doesn’t.TLS protocol selection criteria. Uses Apache’s SSLProtocol format.
--tls-cipher-suite=TLS_CIPHER_SUITETLS cipher selection criteria. Uses Open_SSL’s Cipher List Format.
--tls-keyfile=TLS_KEYFILEPath to the key for mutual authentication, if the Aerospike cluster supports it.
--tls-keyfile-password=TLS_KEYFILE_PASSWORDPassword to load a protected TLS keyfile.

Replace TLS_KEYFILE_PASSWORD with one of the following:
- An environment variable env:VAR.
- A base64-encoded environment variable env-b64:VAR (Tools 13.2.0 and later).
- A base64-encoded string b64:VALUE (Tools 13.2.0 and later).
- The path to a file file:PATH.
- A secret from Aerospike Secret Agent secrets:... (Tools 13.2.0 and later).
- A string: PASSWORD.

If --tls-keyfile-password is specified and no password is provided, the system responds by asking you to enter the user’s password.
--tls-certfile=TLS_CERTFILE PATHPath to the chain file for mutual authentication, if the Aerospike cluster supports it).
--tls-cert-blacklist PATHPath to a certificate blacklist file. The file should contain one line for each blacklisted certificate. Each line starts with the certificate serial number expressed in hexadecimal format. Serial numbers are only required to be unique per issuer. Each entry may optionally specify the issuer name of the certificate. Example:
86EC7A484 /C=US/ST=CA/O=Acme/OU=Eng/CN=TestChainCA
--tls-crl-checkEnable CRL checking for leaf certificate. An error occurs if a valid CRL file cannot be found in tls_capath.
--tls-crl-check-allEnable CRL checking for the entire certificate chain. An error occurs if a valid CRL file cannot be found in tls_capath.
--tls-log-session-infoLog TLS connected session info.
--tls-login-onlyUse TLS for node login only.

The TLS name is only used when connecting with a secure TLS-enabled server.

The following example runs the default benchmark on a cluster of nodes 1.2.3.4 and 5.6.7.8 using:

  • The default Aerospike port of 3000.
  • TLS configured.
  • Namespace TEST.
Terminal window
asbench --hosts 1.2.3.4:cert1:3000,5.6.7.8:cert2:3000 --namespace TEST --tls-enable --tls-cafile /cluster_name.pem --tls-protocols TLSv1.2 --tls-keyfile /cluster_name.key --tls-certfile /cluster_name.pem

Secret Agent options

Starting with Tools 13.2.0, asbench can fetch --password and --tls-keyfile-password values from Aerospike Secret Agent with the secrets: form. Use the following options to connect to the Secret Agent. asbench reads these options from the command line only.

OptionDefaultDescription
--sa-address HOST[:PORT]127.0.0.1:3005Secret Agent hostname or IP address. IPv6 addresses must be enclosed in square brackets.
--sa-port PORT3005Secret Agent port. Overrides a port in --sa-address.
--sa-timeout MS1000Timeout in milliseconds for Secret Agent requests.
--sa-ca-file PATHPath to a CA certificate file. Enables TLS to the Secret Agent and verifies its certificate against this CA. The Secret Agent’s hostname or IP address must be in the certificate.

The following example reads the password from the Secret Agent resource resource1 and the secret pass:

Terminal window
asbench --sa-address 127.0.0.1:3005 -U admin -P secrets:resource1:pass

Global options

OptionDefaultDescription
-z or --threads THREAD_COUNT16Number of threads used to perform synchronous read/write commands. Replace THREAD_COUNT with the number of threads.
--compressdisabledEnable binary data compression through the Aerospike client. Internally, this sets the compression policy to true.
--socket-timeout MS30000Read/Write socket timeout in milliseconds. Replace MS with the number of milliseconds.
--read-socket-timeout MS30000Read socket timeout in milliseconds. Replace MS with the number of milliseconds.
--write-socket-timeout MS30000Write socket timeout in milliseconds. Replace MS with the number of milliseconds.
-T or --timeout MS0Read/Write total timeout in milliseconds. Replace MS with the number of milliseconds.
--read-timeout MS0Read total timeout in milliseconds. Replace MS with the number of milliseconds.
--write-timeout MS0Write total timeout in milliseconds. Replace MS with the number of milliseconds.
--max-retries RETRIES_COUNT1Maximum number of retries before aborting the current transaction. Replace RETRIES_COUNT with the number of retries.
-d or --debugdisabledRun benchmark in debug mode.
-S or --shareddisabledUse shared memory cluster tending.
-C or --replica REPLICA_TYPEmasterWhich replica to use for reads.

Replace REPLICA_TYPE with one of the following:
- master: Always use the node containing the master partition.
- any: Distribute reads across master and proles in round-robin fashion.
- sequence: Always try master first. If master fails, try proles in sequence.
- preferRack: Always try node on the same rack as the benchmark first. If no nodes on the same rack, use sequence. This option requires you to set rack-id.
--rack-id RACK_IDWhich rack this instance of the asbench resides on. Required with replica policy prefer-rack. Replace RACK_ID with the rack’s ID.
-N or --read-mode-ap READ_MODEoneRead mode for AP (availability) namespaces. Replace READ_MODE with either one or all.
-B or --read-mode-sc SC_READ_MODEsessionRead mode for SC (strong consistency) namespaces. Replace SC_READ_MODE with one of the following: session, linearize, allowReplica, or allowUnavailable.
--read-touch-ttl-percent PERCENT0Reset a record’s TTL on reads near its end of life, which lets Aerospike act as a read-based LRU cache. The option sets the client read policy read_touch_ttl_percent for single reads, batch reads, and CDT workload reads, in synchronous and asynchronous mode. Replace PERCENT with one of the following:
- 0: Use the namespace or set default-read-touch-ttl-pct.
- -1: Never reset the TTL on reads.
- 1 to 100: A read in the last PERCENT% of the most recent write TTL resets the TTL. For example, with a write TTL of 10 hours and a value of 80, a read in the last 8 hours of the record’s life resets the TTL to 10 hours.

A non-zero value requires Database 7.1.0 or later. Available in Tools 13.2.0 and later.
-M or --commit-level LEVELallWrite commit guarantee level. Replace LEVEL with either all or master.
-Y or --conn-pools-per-node POOLS_COUNT1Number of connection pools per node. Replace POOLS_COUNT with the number of connection pools.
-D or --durable-deletedisabledAll transactions set the durable-delete flag which indicates to the server that if the transaction results in a delete, generate a tombstone for the deleted record.
--send-keydisabledEnables the key policy AS_POLICY_KEY_SEND, which sends the key value in addition to the key digest.
--sleep-between-retries0Enables sleep between retries if a transaction fails and the timeout was not exceeded.
-c or --async-max-commands COMMAND_COUNT50Maximum number of concurrent asynchronous commands that are active at any time. Replace COMMAND_COUNT with the number of commands.
-W or --event-loops THREAD_COUNT1Number of event loops (or selector threads) when running in asynchronous mode. Replace THREAD_COUNT with the number of threads.

Namespace and record format options

OptionDefaultDescription
-n or --namespace NAMESPACE_NAMEtestAerospike namespace to perform all operations under. Replace NAMESPACE_NAME with the name of the namespace.
-s or --set SET_NAMEtestsetAerospike set to perform all operations in. Replace SET_NAME with the name of the set.
-b or --bin BIN_NAMEtestbinBase name to use for bins. Replace BIN_NAME with the name you want to use.
- The first bin is named BIN_NAME, the second is BIN_NAME_2, the third BIN_NAME_3.
- An unnamed bin keeps the name derived from --bin and its position in the object spec. For example, with -o "id=@uuid, I" the second bin is testbin_2.
- A name that matches another bin’s name, such as testbin_2, is rejected.
- For a repeated bin, the name plus its _N suffix must fit in 15 characters.
-K or --start-key KEY_STARTING_VALUE0Set the starting value of the working set of keys. Replace KEY_STARTING_VALUE with the starting value.

If you are using an insert workload, start-key indicates the first value to write. Otherwise, start-key indicates the smallest value in the working set of keys.
-k or --keys KEYS_COUNT1000000Set the number of keys the client is dealing with. Replace KEYS_COUNT with the number of keys.

If you are using an insert workload, the client writes this number of keys, starting from value = start-key. Otherwise, the client reads and updates randomly across the values between start-key and start-key + num_keys.
-o or --object-spec OBJECT_TYPEI4Set the bin specifications. Replace OBJECT_TYPE with a comma-separated list of bin specifications. See object spec for more details. You can also use synthetic data generators and named bins.
--seed SEEDMakes the generated record data reproducible. Replace SEED with an integer. See Reproducible data. Available in Tools 13.2.0 and later.
--compression-ratio RATIO1Sets the compression ratio for binary data. Replace RATIO with the desired ratio. This option causes the benchmark tool to generate binary data which is roughly compressed by this proportion.

Note: this is only applied to B<n> binary data, not to any of the other types of record data.
-e or --expiration-time0Set the TTL of all records written in write transactions.

Available options are:
- -1: No TTL, never expire.
- -2: Do not modify the record TTL with this write transaction.
- 0: Adopt the default TTL value from the namespace.
- >0: TTL of the record in seconds.

Object spec

The object spec is a flexible way to describe how to structure records being written to the database. The object spec is a comma-separated list of bin specs. Each bin spec is one of the following:

Variable Scalars:

TypeFormatDescription
BooleanbA random boolean bin/value.
IntegerI<n>A random integer with the lower n bytes randomized (and the rest remaining 0). n can range from 1 to 8.

Note: the nth byte is guaranteed to not be 0, except in the case n=1.
DoubleDA random double bin/value (8 bytes).
StringS<n>A random string of length n of either lowercase letters a-z or numbers 0-9.
Binary DataB<n>Random binary data of length n bytes.

Note: if --compression-ratio is set, only the first ratio * n bytes are random. The rest are 0.

Constant Scalars:

TypeFormatExampleNotes
Const Booleantrue/T or false/FtrueThe full-word forms are case-insensitive, but T and F must be capitalized.
Const IntegerA decimal, hex (0x…), or octal (0…) number123
Const DoubleA decimal number with a .123.456Const doubles may optionally be followed by “f” or “F”, but must always contain a decimal.
Const StringA backslash-escaped string enclosed in double quotes”this -> ” is a double quote\n”Strings are backslash-escaped, but so are most terminals, so make sure to escape your backslashes with backslashes when writing object specs in a command line argument. Additionally, double quotes are often special characters, so escape those too.

Collection Bins:

TypeFormatNotes
List[BIN_SPEC,...]A list of one or more bin specs separated by commas.
Map{SCALAR_BIN_SPEC:BIN_SPEC,...}A list of one or more mappings from a scalar bin spec to a bin spec. Anything but a List or Map. These describe the key-value pairs that the Map contains.

Generators:

TypeFormatNotes
Generator@GENERATOR[(ARGUMENTS)]A realistic synthetic value, such as a name or an email address. Available in Tools 13.2.0 and later. See Synthetic data generators.

Named bins

Starting with Tools 13.2.0, you can name any top-level bin by putting NAME= before its spec, for example -o "first=@first_name, age=@int(18,90)". The following rules apply:

  • A name is 1 to 15 characters of letters, digits, _, or -, starts with a letter or _, and is unique in the object spec.
  • Unnamed bins keep the names derived from --bin, such as testbin and testbin_2.
  • A repeated named bin such as tags=3*@word produces the bins tags, tags_2, and tags_3.
  • --read-bins and --write-bins still select bins by position, starting from 1, whatever the bin names.

Synthetic data generators

Starting with Tools 13.2.0, a generator produces a realistic value from dictionaries compiled into asbench, which hold US English names, cities, streets, companies, products, and words. You can use a generator anywhere you can use a scalar: as a top-level bin, a list element, a map value, or a map key. A generator used as a map key must produce strings or integers.

[NAME=][N*]@GENERATOR[(ARGUMENT, ARGUMENT, ...)]

Arguments are integers, doubles, or strings enclosed in double quotes. @pick also accepts weighted items such as "a":70.

GeneratorArgumentsOutput
@first_name, @last_name, @full_name, @usernameString
@email, @phoneString
@street, @city, @state, @state_abbr, @zip, @country, @country_codeString
@lat, @lon(MIN,MAX) in degreesDouble
@geojson(LAT_MIN,LAT_MAX,LON_MIN,LON_MAX)GeoJSON point
@geo_circle(RADIUS_MIN_M,RADIUS_MAX_M[,LAT_MIN,LAT_MAX,LON_MIN,LON_MAX])GeoJSON AeroCircle
@company, @job_title, @product, @colorString
@credit_cardString that passes the Luhn check
@ipv4, @ipv6, @mac, @domain, @urlString
@uuidString, version 4 UUID
@word, @sentenceString
@words(N), default 3String
@lorem(N_CHARS), default 100String
@int(MIN,MAX), inclusiveInteger
@double(MIN,MAX)Double
@date(MIN,MAX[,"FORMAT"])String. The default format is %Y-%m-%d.
@timestamp(MIN,MAX)Integer, epoch seconds
@nowInteger, epoch milliseconds
@pick("A","B",...) or ("A":90,"B":10)String
@fmt("TEMPLATE")String. The template can hold #{GENERATOR} placeholders.

The following notes apply to generators:

  • @date and @timestamp bounds are epoch seconds or "YYYY-MM-DD" dates. Both default to 2020-01-01 through 2029-12-31.
  • @lat, @lon, @geojson, and @geo_circle default to the continental US, with latitude 24 to 49 and longitude -125 to -66. The default @geo_circle radius is 100 to 5000 meters.
  • @fmt placeholders accept any string, integer, or double generator with its arguments, for example @fmt("SKU-#{int(1000,9999)}").
  • A map cannot ask for more unique keys than the key generator has distinct values. For example, {60*@state:I} is rejected because there are 50 states.
  • An object spec that contains generators generates a new record for every write, as if you gave --random.
  • @geojson and @geo_circle write native GeoJSON values, not strings, so you can index them with GEO2DSPHERE, including inside lists and maps.
  • Values are ASCII only, and address fields are drawn independently, so the city, state, and ZIP code in one record do not necessarily match.

The following example writes one million customer profiles:

Terminal window
asbench -h 127.0.0.1 -n test -s customers -w I -k 1000000 --seed 42 \
-o "id=@uuid, first=@first_name, last=@last_name, email=@email, age=@int(18,90), city=@city, loc=@geojson"

The examples/synth directory of the asbench repository has ready-to-run workload stages files for customer profiles, orders, IoT devices, activity feeds, time series, sessions, and leaderboards.

Reproducible data

Starting with Tools 13.2.0, the --seed option makes each record a function of the seed, the record key, and the object spec. Each bin has its own random stream, so:

  • The same key always gets the same bins, whatever the thread count, batch write size, or asynchronous mode.
  • A partial write with --write-bins produces the same values that the full record has in those bins.
  • You can verify a load later by regenerating it with the same seed.

@now does not depend on the seed. CDT workloads draw values from a per-thread stream seeded by --seed and the thread number, so they are reproducible with a single thread (-z 1). Without --seed, each thread uses its own independently seeded random stream.

Multipliers

Multipliers are positive integer constants, followed by an asterisk *, preceding a bin spec.

In the root-level object spec, multipliers indicate how many times to repeat a bin spec across separate bins. For example, the following object specs are equivalent:

I, I, I, I, S10, S10, S10 = 4*I, 3*S10
123, 123, 123, "string", "string" = 3*123, 2*"string"

In a list, multipliers indicate how many times to repeat a bin spec in the list. The following are equivalent:

[I, I, I, I, S10, S10, S10] = [4*I, 3*S10]

In a map, multipliers must precede variable scalar keys. Multipliers indicate how many unique key-value pairs of the given format to insert into the map. Multipliers may not precede const key bin specs or value bin specs in a key-value mapping. The following are equivalent:

{I:B10, I:B10, I:B10} = {3*I:B10}

Workloads

The benchmark tool uses workloads to interact with the Aerospike database. The workload types are:

  • I: Linear Insert. Runs over the range of keys specified and inserts a record with that key.
  • RU,READ_PCT[,READ_PCT_ALL_BINS[,WRITE_PCT_ALL_BINS]]: Random Read/Update. Randomly picks keys, and either writes a record with that key or reads a record from database with that key, with probability according to the given read percentage.
    • Replace READ_PCT with a number between 0 and 100. 0 means only do writes. 100 means only do reads.
    • Starting with asbench 1.5 (Tools 7.1), you may optionally provide READ_PCT_ALL_BINS,WRITE_PCT_ALL_BINS to indicate the percentage of reads and writes that read the entire record. Otherwise only read the first bin. Default is 100.
  • RR,READ_PCT[,<READ_PCT_ALL_BINS[,REPLACE_PCT_ALL_BINS]]: Random Read/Replace/Function. Same as RU, except replaces record instead of updates.
  • RUF,READ_PCT,WRITE_PCT[,READ_PCT_ALL_BINS[,WRITE_PCT_ALL_BINS]]: Random Read/Update/Function. Same as RU, except may also perform an apply command on the random key with a given UDF function.
    • The percentage of operations that are function calls (UDFs) is 100 - READ_PCT - WRITE_PCT. This value must not be negative, which is checked for at initialization.
  • RUD,READ_PCT,WRITE_PCT[,READ_PCT_ALL_BINS[,WRITE_PCT_ALL_BINS]]: Random Read/Update/Delete. Same as RU, except may also perform deletes on a random key.
    • The percentage of operations that deletes is 100 - READ_PCT - WRITE_PCT. This value must not be negative, which is checked for at initialization.
  • C[I|K][,READ_PCT[,CAP[,READ_COUNT]]]: List and map (CDT) workloads. See CDT workloads. Available in Tools 13.2.0 and later.
  • DB: Delete bins. Same as I, but deletes the record with the given key from the database.
    • In order for DB to delete entire records, it must delete every bin that the record contains. Since bin names are based on their position in the object spec, when running this workload, verify you are using the same object spec you used to generate the records being deleted.
    • If you only want to delete a subset of bins, use write-bins to select which bins to delete. DB deletes all bins by default and uses write-bins to determine which bins to delete.

CDT workloads

Starting with Tools 13.2.0, the C, CI, and CK workloads exercise list and map operations on records instead of whole-record puts.

-w C[I|K][,READ_PCT[,CAP[,READ_COUNT]]]
WorkloadBehavior
CEach write appends the generated list to list bins and puts the generated map into map bins. Maps are key ordered.
CILike C, but each generated map entry is a map_increment, for counters and leaderboards. Maps are key-value ordered.
CKLike C, but each map read fetches one generated key instead of a range, for session and attribute maps.
  • READ_PCT is the percentage of operations that are reads. The default is 50.
  • CAP is the number of elements to keep. After each write, a list keeps its last CAP elements, a C or CK map keeps its CAP largest keys, and a CI map keeps its CAP highest values. The default is 0, which means no trimming. With no cap, collections grow until long runs fail with record-too-big errors, so set a cap for long runs.
  • READ_COUNT is the number of elements a read returns. The default is 10. A list read returns the last READ_COUNT elements, a C map read returns the last READ_COUNT entries by key, and a CI map read returns the top READ_COUNT entries by rank.

Each key takes one operate() call, in synchronous and asynchronous mode. Scalar bins are written and read normally. CI needs map values that are integers, doubles, or @int, @double, or @timestamp generators, and increments at most 1000 map entries per write. Do not run an insert workload before a CI workload, so that asbench creates the maps in value order. CDT workloads do not support batch sizes, --read-bins, or --write-bins.

The following example runs a leaderboard workload that increments 5 player scores per write, keeps the top 1000, and reads the top 10:

Terminal window
asbench -n test -s boards -k 10000 -w CI,30,1000,10 -t 60 -o "scores={5*@username:@int(1,100)}"

Workload options

OptionDefaultDescription
--read-binsall binsSpecifies which bins from the object-spec to load from the database on read transactions. Must be given as a comma-separated list of increasing bin numbers, starting from 1.
--write-binsall binsSpecifies which bins from the object-spec to generate and store in the database on write transactions. Must be given as a comma-separated list of bin numbers, starting from 1.
-R or --randomdisabledUse dynamically-generated random bin values for each write transaction instead of fixed values (one per thread) created at the beginning of the workload.
-t or --duration SECONDS10 for RU,RUF workloads, 0 for I,DB workloadsSpecifies the minimum amount of time the benchmark runs for. Replace SECONDS with the number of seconds. For random workloads with no finite amount of work needing to be done, this value must be above 0 for anything to happen. For workloads with a finite amount of work, like linear insertion/deletion, set this value to 0.
-w or --workload WORKLOAD_TYPERU,50Desired workload. Replace WORKLOAD_TYPE with the workload type.
--workload-stages PATH/TO/WORKLOAD_STAGES.yamldisabledAccepts a path to a workload stages YAML file, which should contain a list of workload stages to run through. See workload stages.
-g or --throughput TPS0Throttle transactions per second to a maximum value. Replace TPS with transactions per second. If transactions per second is zero, throughput is not throttled.
--batch-size SIZE1Enable all batch modes with a number of records to process in each batch call. Replace SIZE with the number of records. Batch mode is applied to the read, write, and delete transactions in I, RU, RR, RUF, and RUD workloads. If batch size is 1, batch mode is disabled.
--batch-read-size SIZE1Enable batch read mode with a number of records to process in each batch read call. Replace SIZE with the number of records. Batch read mode is applied to the read transactions in RU, RR, RUF, and RUD workloads. If batch read size is 1, batch read mode is disabled. Batch read size takes precedence over batch size.
--batch-write-size SIZE1Enable batch write mode with a number of records to process in each batch write call. Replace SIZE with the number of records. Batch write mode is applied to the write transactions in I, RU, RUF, and RUD workloads. If batch write size is 1, batch write mode is disabled. Batch write size takes precedence over batch size.
--batch-delete-size SIZE1Enable batch delete mode with a number of records to process in each batch delete call. Replace SIZE with the number of records. Batch delete mode is applied to the delete transactions in RUD and BD workloads. If batch delete size is 1, batch delete mode is disabled. Batch delete size takes precedence over batch size.
-a or --asyncdisabledEnable asynchronous mode, which uses the asynchronous variant of every Aerospike C Client method for transactions.

Workload stages

You can run multiple different workloads in sequence using the --workload-stages option with a workload stage configuration file, which is in YAML format. The configuration file should only be a list of workload stages in the following format:

- stage: 1
# required arguments
workload: WORKLOAD_TYPE
# optional arguments
duration: SECONDS
tps : max possible with 0 (default), or specified transactions per second
object-spec: Object spec for the stage. Otherwise, inherits from the previous
stage, with the first stage inheriting the global object spec.
key-start: Key start, otherwise inheriting from the global context
key-end: Key end, otherwise inheriting from the global context
read-bins: Which bins to read if the workload includes reads
write-bins: Which bins to write to if the workload includes writes
pause: max number of seconds to pause before the stage starts. Waits a random
number of seconds between 1 and the pause.
async: when true/yes, uses asynchronous commands for this stage. Default is false
random: when true/yes, randomly generates new objects for each write. Default is false
batch-size: specifies the batch size for all batch transactions for this stage. Default is 1
batch-read-size: specifies the batch size of reads for this stage. Takes precedence over batch-size. Default is 1
batch-write-size: specifies the batch size of writes for this stage. Takes precedence over batch-size. Default is 1
batch-delete-size: specifies the batch size of deletes for this stage. Takes precedence over batch-size. Default is 1
- stage: 2
...

Each stage must begin with stage: STAGE_NUMBER, where STAGE_NUMBER is the position of the stage in the list. The stages must appear in order.

When arguments say they inherit from the global context, the value they inherit either comes from a command line argument, or is the default value if no command line argument for that value was given.

Below is an example workload stages file, call it workload.yml.

- stage: 1
duration: 60
workload: RU,80
object-spec: I2,S12,[3*I1]
- stage: 2
duration: 30
workload: I
object-spec: {5*S1:I1}

To use workload.yaml with asbench, run the following.

Terminal window
asbench --workload-stages=workload.yml

Latency histograms

There are multiple ways to record latencies measured throughout a benchmark run. All latencies are recorded in microseconds.

OptionDefaultDescription
--output-filestdoutSpecifies an output file to write periodic latency data, which enables tracking of transaction latencies in microseconds in a histogram. Currently uses a default layout. The file is opened in append mode.
-L or --latencydisabledEnables the periodic HDR histogram summary of latency data.
--percentiles P_1[,P_2[,P_3...]]”50,90,99,99.9,99.99”Specifies the latency percentiles to display in the periodic latency histogram.
--output-period SECONDS1Specifies the period between successive snapshots of the periodic latency histogram. Replace SECONDS with the period in seconds.
--hdr-hist PATH_TO_OUTPUTdisabledEnables the cumulative HDR histogram and specifies the directory to dump the cumulative HDR histogram summary.

Periodic latency histogram

Periodic latency data is stored in the --output-file specified and recorded in histograms with three ranges of fixed bucket sizes. The three ranges are not configurable. There is one histogram for reads, one for writes, and one for UDF calls.

The three ranges are:

  • 100us to 4000us, bucket width 100us
  • 4000us to 64000us, bucket width 1000us
  • 64000us to 128000us, bucket width 4000us

Format of the histogram output file:

HIST_NAME UTC_TIME, PERIOD_TIME, TOTAL_LATENCIES, BUCKET_1_LOWER_BOUND:BUCKET_1_LATENCIES, ...
  • HIST_NAME: Name of the histogram, either read_hist, write_hist, or udf_hist.
  • UTC_TIME: UTC time of the end of the interval.
  • PERIOD_TIME: Length of the interval in seconds.
  • TOTAL_LATENCIES : Total number of transaction latencies recorded in the interval.
  • BUCKET_1_LOWER_BOUND: Each bucket with at least one latency recorded is displayed in ascended number of interval lower bounds.
  • BUCKET_1_LATENCIES: Number of transaction latencies falling within the bucket’s range.

HDR histogram

Transaction latencies can also be recorded in an HDR histogram. There is one HDR histogram for reads, one for writes, and one for UDF calls.

Use one of the following to enable HDR histograms:

  • --latency: Displays select percentiles from the HDR histograms every output-period seconds.
    • The percentiles that are printed when --latency is enabled can be configured with --percentiles followed by a comma-separated list of percentiles. This list must be in ascending order. No percentile can be less than 0, or greater than or equal to 100.
  • --hdr-hist: Writes the full HDR histograms to the given directory in both a human-readable text format (.txt) and a binary encoding of the HDR histogram (.hdrhist).

UDFs

UDF calls are made in RUF (read/update/function) workloads, being the “function” part of that workload. A key is chosen at random from the range of keys given, and an Aerospike apply call is made on that key with the given UDF function (--udf-function-name) from the given UDF package (--udf-package-name). Optionally, --udf-function-values may be supplied, which takes an object spec and randomly generates arguments every call.

OptionDefaultDescription
-upn or --udf-package-name PACKAGE_NAME-The package name for the UDF to be called. Replace PACKAGE_NAME with the package name.
-ufn or --udf-function-name FUNCTION_NAME-Name of the UDF function in the package to be called. Replace FUNCTION_NAME with the function name.
-ufv or --udf-function-values FUNCTION_VALUESnoneArguments to be passed to the UDF when called, which are given as an object spec (see object spec). Replace FUNCTION_VALUES with the arguments.