Runtime Tables
Orleans maintains a number of internal tables for different runtime mechanisms. Here we list all the tables and provide more details on their internal structure.
Runtime tables:
- Orleans Silo Instances table
- Reminders table
- Silo Metrics table
- Clients Metrics table
- Silo Statistics table
- Clients Statistics table
Orleans Silo Instances table
Orleans Silo Instances table, also commonly referred to as Membership table, lists the set of silos that make an Orleans deployment. More details can be found in the description of the Cluster Management Protocol that maintains this table.
All rows in this table consist of the following columns (SiloInstanceTableEntry
):
- PartitionKey - deployment id.
- RowKey - Silo IP Address + "-" + Silo Port + "-" + Silo Generation number (epoch)
- DeploymentId - the deployment id of this Orleans service
- Address - IP address
- Port - silo to silo TCP port
- Generation - Generation number (epoch number)
- HostName - silo Hostname
- Status - status of this silo, as set by cluster management protocol. Any of the type
Orleans.Runtime.SiloStatus
- ProxyPort - silo to clients TCP port
- Primary - whether this silo is primary or not. Deprecated.
- RoleName - If running in Azure - the name of this role. If running on premises, the name of the executing assembly.
- InstanceName - If running in Azure - the name of this role instance. If running on premises, the silo name that the silo host gave it.
- UpdateZone - Azure update zone, if running in Azure.
- FaultZone - Azure fault zone, if running in Azure.
- SuspectingSilos - the list of silos that suspect this silo. Managed by cluster management protocol.
- SuspectingTimes - the list of times when this silo was suspected. Managed by cluster management protocol.
- StartTime - the time when this silo was started.
- IAmAliveTime - the last time this silo reported that it is alive. Used for diagnostics and troubleshooting only.
There is also a special row in this table, called membership version row, with the following columns:
- PartitionKey - deployment id.
- RowKey - "VersionRow" costant string
- DeploymentId
- MembershipVersion - the latest version of the current membership configuration.
Naming:
The silo instance row has 3 names: hostname, rolename and instance name. What is the difference?
First, it is important to note that Orleans cluster protocol does not use any of these names for distinguishing between silos. Instead it uses IP:port:epoch
as a unique identity of a silo instance. Therefore, setting of those 3 names has no impact on runtime correctness. It is in the table merely to help diagnostics and operational troubleshooting.
Hostname is always set to the name of this host, as returned by Dns.GetHostName()
.
Role name is a logical name of the whole service and instance name is the name of this specific silo instance within this service.
Role name and Instance name depend on the hosting - where the silo runs. Each silo host can set those differently.
Azure host (AzureSiloHost
) sets the role name to Azure role name (myRoleInstance.Role.Name
) and instance name to Azure role Instance name (myRoleInstance.Id
).
On premises (SiloHost
) the role name is the executing assembly name (Assembly.GetExecutingAssembly().GetName().Name
) and the instance name is the name the host gave to that silo when it was started.
Orleans Reminders table
Orleans Reminders table durably stores all the reminders registered in the system. Each reminder has a separate row. All rows in this table consist of the following columns (ReminderTableEntry
):
- PartitionKey - ServiceId + "_" + GrainRefConsistentHash
- RowKey - GrainReference + "-" ReminderName
- GrainReference - the grain reference of the grain that created this reminder.
- ReminderName - the name of this reminder
- ServiceId - the service id of the currently running Orleans service
- DeploymentId - the deployment id of the currently running Orleans service
- StartAt - the time when this reminder was supposed to tick in the first time
- Period - the time period for this reminder
- GrainRefConsistentHash - the consistent hash of the GrainReference
Silo Metrics table
Silo metrics table contains a small set of per-silo important key performance metrics (usually known as KPI - Key Performance Indicators). Each silo has one row, periodically updated in-place by its silo (SiloMetricsData
).
- PartitionKey - DeploymentId
- RowKey - silo name
- DeploymentId - the deployment id of this Orleans service
- Address - the silo address (ip:port:epoch) of this silo
- SiloName - the name of this silo (in Azure it is its Instance name)
- GatewayAddress - the gateway ip:port of tis silo
- HostName - the hostname of this silo
- CPU - current CPU utilization
- MemoryUsage - current memory usage (
GC.GetTotalMemory(false)
) - Activations - number of activations on this silo
- RecentlyUsedActivations - number of activations on this silo that were used in the last 10 minutes (Note: this number may currently not be accurate if different age limits are used for different grain types).
- SendQueue - the current size of the send queue (number of messages waiting to be send). Only captures remote messages to other silos (not including messages to the clients).
- ReceiveQueue - the current size of the receive queue (number of messages that arrived to this silo and are waiting to be dispatched). Captures both remote and local messages from other silos as well as from the clients.
- RequestQueue
- SentMessages - total number of remote messages sent to other silos as well as to the clients.
- ReceivedMessages - total number of remote received messages, from other silos as well as from the clients.
- LoadShedding - whether this silo is currently overloaded and is in the load shedding mode.
- Clients - number of currently connected clients
Clients Metrics table
Silo metrics table containes a small set of per-Orleans-client important key performance metrics. Each client has one row, periodically updated in-place by its client. Client metrics are essentilay a subset of silo metrics (ClientMetricsData
).
- PartitionKey - DeploymentId
- RowKey - Address
- DeploymentId - the deployment id of this Orleans service
- Address - the address (ip:port) of this client
- ClientId - the unique name of this client (pseudo client grain id)
- HostName - the hostname of this client
- CPU - current CPU utilization
- MemoryUsage - current memory usage (
GC.GetTotalMemory(false)
) - SendQueue - the current size of the send queue (number of messages waiting to be send). Captures remote messages to other silos.
- ReceiveQueue - the current size of the receive queue (number of messages that arrived to this client and are waiting to be dispatched, including responses).
- SentMessages - total number of remote messages sent to silos.
- ReceivedMessages - total number of remote received messages from silos.
- ConnectedGatewayCount - number of gateways that this client is currently connected to.
Silo Statistics table
Silo Statistics table containes a large set of per-silo detailed statistic counters. Most of them are low level performance statistics, which are usualy used in troubleshooting scenarios. A set of examples and methodology of how those statistics can be used are described in our paper PAD: Performance Anomaly Detection in Multi-Server Distributed Systems and a proof of concept. Each statistic value is one row. This table is append only. Every silo periodicaly (usually every 5 minutes, configurable) appends all its latest statistic counter values. The number of counters per silo is currently about 200. So every 5 minutes every silo appends around 200 rows to this table.
Each row is in the format (StatsTableData
):
- PartitionKey -
DeploymentId$ReverseTimestampToTheNearestHour
- deploymentId and last hour - RowKey -
ReverseTimestampToTheNearestSecond$Name$counter
- current second, silo name, monotonically growing sequence number - DeploymentId - the deployment id of this Orleans service
- Time - the current time of the reporting on the reporting silo
- Address - the silo address (ip:port:epoch) of this silo
- Name - the name of this silo (in Azure it is its Instance name)
- HostName - the host name of this silo
- Statistic - the name of the statistic counter
- StatValue - the value of the statistic counter
- IsDelta - if this the statistic counter value is delta since last value reported or an absolute value
The rationale behind the choice of partition key and row key is described here and here.
Clients Statistics table
Same as Silo Statistics table but for client.