FAQ - Understanding time to live on an Aerospike cluster


#1

How do I use configurations default-ttl, max-ttl and cold-start-evict-ttl?

  • By default, Aerospike does not set any time-to-live on the records that it writes on the server unless default-ttl is set on the namespace and relies on the application to maintain or clean-up data as necessary. In the event that you rely on Aerospike’s expirations to maintain the capacity limits on the server, you can set the default-ttl accordingly. Note that this is set at the namespace level and is a dynamic configuration (does not require an Aerospike service restart).
  • max-ttl defines the upper limit to the TTL that can be set on the records. This configuration is used to prevent the server from getting data from rogue clients with TTL higher than expected. This has an upper limit of 10 years (even if this configuration is not set explicitly).
  • default-ttl cannot be set higher than the max-ttl.
  • cold-start-evict-ttl is used to define the TTL such that records having TTL below this value will be evicted during a cold-start of Aerospike service. This helps speed up cold-start process which is a complete scan of the disk and can be time taking depending on the data on the devices.

What is the maximum limit of these configurations that can be set on a namespace?

  • default-ttl cannot be set higher than max-ttl.
  • max-ttl cannot be set higher than 10 years (for versions 3.8.3 and above).
  • cold-start-evict-ttl does not have an upper limit as such, but knowing that the max-ttl on the server cannot be beyond 10 years, this limit holds true for the cold-start-evict-ttl as well.

What do these log lines refer to?

For version 3.8.3 and above

  1. If the max-ttl is configured lower than the default-ttl:
WARNING (info): (thr_info.c:2934) max-ttl must be >= default-ttl (current value in seconds)
  1. If the incoming TTL record is configured more than the configured max-ttl:
WARNING (rw): (write.c:776) write_master: invalid ttl 'value of incoming TTL'
  1. If the max-ttl is configured to higher than the global maximum of 10 years:
WARNING (info): (thr_info.c:2930) max-ttl must be non-zero and <= 315360000 seconds

For versions prior to 3.8.3

The following warnings are seen which point towards an anomaly in the TTL values.

Note that in versions prior to 3.8.3, we did not have an explict check on the default-ttl and max-ttl values. And the default value of max-ttl was 0.

  1. If the incoming TTL is configured more than the max-ttl (e.g. max-ttl = 8640000 = 100 days), you could see one of these warnings:
WARNING (rw): (thr_rw.c:3226) write_local: incoming ttl 4294938278 too big compared to 8640000
WARNING (rw): (thr_rw.c::3197) record TTL 1459720873 exceeds warning threshold 315360000 - set config value max-ttl to suppress this warning

Configuration reference

default-ttl http://www.aerospike.com/docs/reference/configuration#default-ttl

max-ttl http://www.aerospike.com/docs/reference/configuration#max-ttl

cold-start-evict-ttl http://www.aerospike.com/docs/reference/configuration#cold-start-evict-ttl

Details on setting TTL from server and application

http://www.aerospike.com/docs/operations/manage/storage

Keywords

TTL MAX-TTL DEFAULT-TTL

Timestamp

07/20/2016