Note
For V4.4.2, this view is available starting from V4.4.2 BP4.
Overview
This view displays the Java UDF sandbox status of all tenants on the current OBServer node, including information such as the lifecycle of sandbox generations, communication channel pools, sandbox process resources, and sandbox JVM resources.
The usage instructions are as follows:
- When the parameter
ob_enable_java_udf_sandboxis enabled, Java UDFs are executed in independent sandbox processes. Each row corresponds to a generation of sandboxes, and each generation corresponds to a sandbox JVM process. - This view only displays existing sandboxes. Querying this view does not trigger sandbox creation.
- The sys tenant can view the sandboxes of all tenants, while a user tenant can only view its own sandbox.
INSTANCE_COUNTtoLAST_FORCE_KILL_REASONare tenant-level summary information. The values for each column are the same for rows belonging to the same tenant.- Metrics that have not been successfully collected or cannot be obtained are displayed as NULL, to distinguish them from metrics whose actual value is
0.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| TENANT_ID | bigint(20) | NO | Tenant ID. |
| GENERATION_ID | bigint(20) | NO | Sandbox generation ID. Each sandbox generation corresponds to a sandbox JVM process. |
| GENERATION_STATE | varchar(32) | YES | The lifecycle status of this generation sandbox:
|
| STATUS | varchar(32) | NO | The running status of the sandbox:
|
| PROCESS_PID | bigint(20) | YES | The process ID of the sandbox JVM process. |
| START_TIME | timestamp(6) | YES | The startup time of the sandbox. |
| UPTIME_MS | bigint(20) | YES | The duration for which the sandbox has been running, in milliseconds. |
| DRAIN_REASON | varchar(32) | YES | The reason why the sandbox has entered the empty state. Only whenGENERATION_STATEisDRAININGSometimes:
|
| DRAIN_DEADLINE | timestamp(6) | YES | The deadline for emptying. Only whenGENERATION_STATEisDRAININGThere is a time limit. If the sandbox process has not completed draining by this time, it will be forcibly terminated. |
| FORCE_KILLED | tinyint(4) | YES | Whether the sandbox process was forcibly terminated:
|
| FORCE_KILL_REASON | varchar(32) | YES | Reason for forced termination. Valid values:DRAIN_REASONThe same. Only whenFORCE_KILLEDis1Sometimes has a value. |
| INSTANCE_COUNT | bigint(20) | YES | The current number of sandbox instances for this tenant. |
| MAX_GENERATION_COUNT | bigint(20) | YES | The maximum number of sandboxes that can exist simultaneously for this tenant. |
| DRAINING_GENERATION_COUNT | bigint(20) | YES | The current sandbox algebra of the tenant is empty. |
| DEFERRED_GENERATION_COUNT | bigint(20) | YES | Algebra of sandboxes pending delayed reclamation for this tenant. |
| START_COUNT | bigint(20) | YES | The cumulative number of sandbox starts for this tenant. |
| RESTART_COUNT | bigint(20) | YES | The cumulative number of restarts for this tenant sandbox, excluding the initial startup. |
| START_FAILURE_COUNT | bigint(20) | YES | The cumulative number of failed startups for this tenant sandbox. |
| LAST_START_ERROR_CODE | bigint(20) | YES | The error code of the tenant's most recent failed sandbox startup. This parameter is NULL if no startup failures have occurred. |
| LAST_START_ERROR_TIME | timestamp(6) | YES | The time when the last sandbox startup of the tenant failed. This column is NULL if no startup failures have occurred. |
| ROLLOVER_COUNT | bigint(20) | YES | The cumulative rollover count of this tenant sandbox, which is the number of times a new-generation sandbox has replaced an old one. |
| ROLLOVER_COUNT_60S | bigint(20) | YES | The number of sandbox replacements for the tenant in the last 60 seconds. |
| LAST_ROLLOVER_REASON | varchar(32) | YES | The reason for the last sandbox replacement of this tenant. Valid values:DRAIN_REASONSame as the original value. NULL if no replacement has occurred. |
| LAST_ROLLOVER_TIME | timestamp(6) | YES | The last sandbox replacement time for this tenant. NULL if no replacement has occurred. |
| ROLLOVER_COOLDOWN_REMAIN_US | bigint(20) | YES | The remaining time of the cooldown period for sandbox replacement, in microseconds. The cooldown period is entered if replacements occur too frequently within a short period. When not in the cooldown period, it is0. |
| FORCE_KILL_COUNT | bigint(20) | YES | The cumulative number of forced terminations of the tenant's sandbox process. |
| LAST_FORCE_KILL_REASON | varchar(32) | YES | The reason for the last forced termination of the sandbox process for this tenant. Valid values:DRAIN_REASONSame as the original. NULL if no forced termination has occurred. |
| CHANNEL_POOL_CAPACITY | bigint(20) | YES | The capacity of the communication channel pool between OBServer nodes and sandbox processes. |
| FREE_CHANNEL_COUNT | bigint(20) | YES | Number of idle communication channels. |
| ACQUIRED_CHANNEL_COUNT | bigint(20) | YES | The number of communication channels in use. |
| QUARANTINED_CHANNEL_COUNT | bigint(20) | YES | The number of communication channels in the isolated state. |
| REAPING_CHANNEL_COUNT | bigint(20) | YES | The number of communication channels being reclaimed. |
| DISCARDED_CHANNEL_COUNT | bigint(20) | YES | The number of discarded communication channels. |
| DISCARDED_CHANNEL_THRESHOLD | bigint(20) | YES | The threshold for the number of discarded communication channels. |
| CHANNEL_ROLLOVER_REQUIRED | varchar(3) | YES | Whether the generation sandbox needs to be replaced due to a communication channel exception:
|
| CHANNEL_ACQUIRE_FAIL_COUNT | bigint(20) | YES | The cumulative number of failures in obtaining the communication channel. |
| CHANNEL_QUARANTINE_COUNT | bigint(20) | YES | The cumulative number of times the communication channel has been isolated. |
| CHANNEL_RECOVERED_COUNT | bigint(20) | YES | The cumulative number of times the communication channel has recovered from an isolated state. |
| CHANNEL_DISCARD_EVENT_COUNT | bigint(20) | YES | The cumulative number of times the communication channel has been discarded. |
| INFLIGHT_REQUEST_COUNT | bigint(20) | YES | The number of requests being processed by this generation sandbox. |
| GENERATION_TIMEOUT_COUNT | bigint(20) | YES | The number of request timeouts for this generation sandbox. |
| GENERATION_OOM_COUNT | bigint(20) | YES | The number of OOMs that occur in this generation sandbox. |
| GENERATION_LAST_OOM_TIME | timestamp(6) | YES | The last time OOM occurred in this generation sandbox. |
| LAST_REQUEST_TIME | timestamp(6) | YES | The last time the sandbox received a request. |
| MAX_INFLIGHT_DEADLINE | timestamp(6) | YES | The latest deadline for requests currently in the sandbox. |
| PROCESS_RSS_BYTES | bigint(20) | YES | The Resident Set Size (RSS) of the sandbox process, in bytes. |
| PROCESS_CPU_TIME_US | bigint(20) | YES | The cumulative CPU time of the sandbox process, in microseconds. |
| PROCESS_CPU_USAGE_PERCENT | double | YES | CPU usage of the sandbox process (%). |
| PROCESS_STATUS | varchar(32) | YES | Sandbox process status:
|
| OS_PROCESS_STATE | varchar(4) | YES | The status of the sandbox process in the operating system. The possible values are the same as those for Linux processes, for example:R(Running),S(Wakeable),D(unsleepable),Z(Zombie),T(Stop). |
| PROCESS_MEMORY_LIMITED | tinyint(4) | YES | Whether the sandbox process is in a memory-limited state:
|
| PROCESS_RESOURCE_ERROR_CODE | bigint(20) | YES | The error code of the most recent sandbox process resource collection. |
| PROCESS_RESOURCE_SNAPSHOT_TIME | timestamp(6) | YES | The time when the sandbox process resource information was last successfully collected. |
| MONITOR_STATUS | varchar(32) | YES | Sandbox JVM monitoring reported status:
|
| MONITOR_MESSAGE_VERSION | bigint(20) | YES | The version number of the monitoring report message. |
| MONITOR_REPORT_SEQ | bigint(20) unsigned | YES | The serial number of the most recent monitoring report. |
| MONITOR_DROPPED_REPORT_COUNT | bigint(20) | YES | The number of discarded monitoring report messages. |
| MONITOR_ERROR_CODE | bigint(20) | YES | Error code reported for monitoring. NULL if no error occurred. |
| LAST_MONITOR_ERROR_TIME | timestamp(6) | YES | The time when the last monitoring report failed. |
| LAST_MONITOR_MESSAGE_TIME | timestamp(6) | YES | The last time when monitoring data was reported. |
| JVM_START_TIME | timestamp(6) | YES | The startup time of the sandbox JVM. |
| JVM_UPTIME_MS | bigint(20) | YES | The duration for which the sandbox JVM has been running, in milliseconds. |
| MONITOR_BRIDGE_VERSION | bigint(20) | YES | The version number of the sandbox JVM monitoring API. |
| HEAP_USED_BYTES | bigint(20) | YES | The size of memory used by the sandbox JVM heap, in bytes. |
| HEAP_COMMITTED_BYTES | bigint(20) | YES | The size of committed memory in the sandbox JVM heap, in bytes. |
| HEAP_MAX_BYTES | bigint(20) | YES | The maximum size of the sandbox JVM heap memory, in bytes. |
| YOUNG_USED_BYTES | bigint(20) | YES | The size of memory already used by the young generation of the sandbox JVM, in bytes. |
| OLD_USED_BYTES | bigint(20) | YES | The size of memory used by the sandbox JVM in previous generations, in bytes. |
| METASPACE_USED_BYTES | bigint(20) | YES | The size of the sandbox JVM's metaspace that is in use, in bytes. |
| METASPACE_COMMITTED_BYTES | bigint(20) | YES | The size of the committed metaspace in the sandbox JVM, in bytes. |
| METASPACE_MAX_BYTES | bigint(20) | YES | The maximum available size of the sandbox JVM metaspace, in bytes. |
| CODE_CACHE_USED_BYTES | bigint(20) | YES | The size of the code cache used by the sandbox JVM, in bytes. |
| DIRECT_BUFFER_USED_BYTES | bigint(20) | YES | The memory size occupied by the Direct Buffer of the sandbox JVM, in bytes. |
| DIRECT_BUFFER_COUNT | bigint(20) | YES | The number of direct buffers in the sandbox JVM. |
| GC_COUNT | bigint(20) | YES | Cumulative number of GCs in the sandbox JVM. |
| GC_TIME_MS | bigint(20) | YES | The cumulative GC time of the sandbox JVM, in milliseconds. |
| YOUNG_GC_COUNT | bigint(20) | YES | Cumulative Number of Young Generation GCs in the Sandbox JVM |
| YOUNG_GC_TIME_MS | bigint(20) | YES | The cumulative young generation GC time of the sandbox JVM, in milliseconds. |
| MAJOR_GC_COUNT | bigint(20) | YES | The cumulative number of major GCs in the sandbox JVM. |
| MAJOR_GC_TIME_MS | bigint(20) | YES | Cumulative Major GC Time of the Sandbox JVM, in milliseconds. |
| THREAD_COUNT | bigint(20) | YES | The current number of threads in the sandbox JVM. |
| PEAK_THREAD_COUNT | bigint(20) | YES | The peak number of threads for the sandbox JVM. |
| OPEN_FD_COUNT | bigint(20) | YES | The number of file descriptors currently open by the sandbox process. |
| MAX_FD_COUNT | bigint(20) | YES | The maximum number of file descriptors that a sandbox process can open. |
| COLLECT_ERROR_CODE | bigint(20) | YES | The error code from the most recent collection by the sandbox JVM.0indicates a successful collection. |
| COLLECT_COST_US | bigint(20) | YES | The time consumed in the most recent collection of the sandbox JVM, in microseconds. |
| LAST_COLLECT_ATTEMPT_TIME | timestamp(6) | YES | The last collection time of the sandbox JVM. |
| SNAPSHOT_TIME | timestamp(6) | YES | The time when the sandbox JVM resource data was last successfully reported. |
| SNAPSHOT_AGE_US | bigint(20) | YES | Time elapsed since the last successful report of sandbox JVM resource data, in microseconds. |
Sample query
Query the status and memory usage of Java UDF sandboxes for all tenants on the current OBServer node.
obclient> SELECT SVR_IP, TENANT_ID, GENERATION_ID, GENERATION_STATE, STATUS, PROCESS_PID, PROCESS_RSS_BYTES, HEAP_USED_BYTES, MONITOR_STATUS FROM oceanbase.V$OB_JAVA_SANDBOX_STATUS;