Skip to main content
Loading

Managing Scans

info

This page is now obsolete. Refer to Manage Queries for current information. Prior to Server 6.0, primary index (PI) queries were called scans and secondary index (SI) queries were called queries. Both types of query are managed through a unified interface and run on a common subsystem.

Aerospike scans are long-running, resource-intensive jobs. These jobs walk through an entire namespace and:

  • Read records, taking up storage I/O resources.
  • May run UDFs (query UDF) on records, taking up CPU resources.
  • May return large amounts of data to the client (e.g. the backup tool), taking up network bandwidth.

Aerospike provides a set of configuration parameters and an API to manage scans. For more information regarding their default values, please see Configuration Reference.

Server 4.7 to 5.7

Manage

note

Tools package 6.0.x or later is required to use asadm's manage config commands. Otherwise, use the equivalent asinfo - set-config command.

danger

The following info commands were renamed from scan- to query- in Server 6.0.

Maximum number of threads available for all concurrently running scans:

asadm -e "enable; manage config service param scan-threads-limit to 100"

Maximum records per second (rps) allowed for a background scan:

asadm -e "enable; manage config namespace <namespace> param background-scan-max-rps to 5000"

Maximum number of threads allowed for a single scans:

asadm -e "enable; manage config namespace <namespace> param single-scanthreads to 10"

Maximum number of finished scans that can be kept around for monitoring:

asadm -e "enable; manage config service param scan-max-done to 10"

Maximum number of active scans that can be initialized concurrently:

asadm -e "enable; manage config service param scan-max-active to 10"

Maximum number of finished scans that can be kept around for monitoring:

asadm -e "enable; manage config service param scan-max-done to 10"

Configure number of scan threads to throttle the scan performance:

asadm -e "enable; manage config service param scan-threads to 5"

Set priority and kill scan jobs

For Server 4.7.0 and later, scan jobs can be given a specified records per second (rps) value to control their execution speed. The rps may only be specified when initiating the scan job, and cannot be changed.

Scans start with a single thread and add threads as needed (up to the configured thread limits) to achieve the specified rps. If a single thread would exceed the specified rps, throttling will occur within the thread to achieve the specified rps.

If the rps is not specified, the scan will run as quickly as possible. That is, the scan will not be throttled, and will use as many threads as allowed by the configured limits.

For backward compatibility with scan requests specifying a priority instead of an rps value, a priority of 1 (low priority) is converted to 5000 rps. Other priorities are not converted to an rps, so that the scan runs as quickly as possible.


Scan Job Kill:

The following commands cause running scan jobs to stop.

With Tools package 6.2.x or later:

asadm -e 'enable; manage jobs kill trid <jobid>'

With asinfo:

For Server 5.7 or later, use asinfo -v 'scan-show' to see the list of scan jobs with job IDs, then do this:

danger

The scan-abort and scan-abort-all info commands were deprecated in Server 6.0 and removed in Server 6.4. Use the info commands query-abort and query-abort-all instead. The jobs info command was deprecated in Server 5.7 and removed in Server 6.3. Use the info command query-show instead.

asinfo -v 'scan-abort:id=<jobid>'

For Server prior to 5.7, to see the list of jobs and the job ID, use asinfo -v 'jobs:', then do either of these:

asinfo -v 'jobs:module=scan;cmd=kill-job;trid=<jobid>'
asinfo -v 'scan-abort:id=<jobid>'

The following commands will cause all running PI query jobs to stop (available for Server 3.5.12 and later).

With Tools package 6.2.x or later.

asadm -e 'enable; manage jobs kill all scans'

With asinfo:

asinfo -v 'scan-abort-all:'
OK - number of scans killed: 1

List PI Queries

Aerospike scans are long-running slow operations which generally run in the background. A scan can be considered as a type of job. They can be monitored either using Aerospike Management Console or using the command line.

With Tools package 6.2.x or later.

asadm -e 'show jobs scans'
asadm -e 'show jobs scans trid <jobid>'

or with an info command.

danger

The scan-show info command was deprecated in server 6.0 and removed in server 6.4. Use the info command query-show.

asinfo -v 'scan-show'
asinfo -v 'scan-show:trid=<jobid>'

With Server 5.6 or earlier:

asinfo -v 'scan-list'

For more information, see Info Command Reference.