Loading...
Searching...
No Matches
Data Fields
as_policy_event Struct Reference

Detailed Description

Asynchronous event loop configuration.

Definition at line 56 of file as_event.h.

#include "as_event.h"

+ Collaboration diagram for as_policy_event:

Data Fields

int max_commands_in_process
 
uint32_t max_commands_in_queue
 
uint32_t queue_initial_capacity
 

Field Documentation

◆ max_commands_in_process

int as_policy_event::max_commands_in_process

Maximum number of async commands that can be processed in each event loop at any point in time. Each executing non-pipeline async command requires a socket connection. Consuming too many sockets can negatively affect application reliability and performance. If the user does not limit async command count in their application, this field should be used to enforce a limit internally in the client.

If this limit is reached, the next async command will be placed on the event loop's delay queue for later execution. If this limit is zero, all async commands will be executed immediately and the delay queue will not be used.

If defined, a reasonable value is 40. The optimal value will depend on cpu count, cpu speed, network bandwitdh and the number of event loops employed.

Default: 0 (execute all async commands immediately)

Definition at line 73 of file as_event.h.

◆ max_commands_in_queue

uint32_t as_policy_event::max_commands_in_queue

Maximum number of async commands that can be stored in each event loop's delay queue for later execution. Queued commands consume memory, but they do not consume sockets. This limit should be defined when it's possible that the application executes so many async commands that memory could be exhausted.

If this limit is reached, the next async command will be rejected with error code AEROSPIKE_ERR_ASYNC_QUEUE_FULL. If this limit is zero, all async commands will be accepted into the delay queue.

The optimal value will depend on your application's magnitude of command bursts and the amount of memory available to store commands.

Default: 0 (no delay queue limit)

Definition at line 90 of file as_event.h.

◆ queue_initial_capacity

uint32_t as_policy_event::queue_initial_capacity

Initial capacity of each event loop's delay queue. The delay queue can resize beyond this initial capacity.

Default: 256 (if delay queue is used)

Definition at line 98 of file as_event.h.


The documentation for this struct was generated from the following file: