PGX 21.1.1
Documentation

Data Memory Limits Configuration Guide

This chapter explains the configuration options for PGX data memory limits, the configured limits are per PGX server instance.

Data memory limits allow PGX server admins to control the maximum memory usage for users and session, as well as for shared data (e.g., published graphs).

Admins can configure limits for any user / session, can set specific limits per individual session (at runtime) or per individual user or authorization role.

As mentioned in the figure below, session limit is bounded to the user limit, which is bounded to private section limit, shared and private sections are bounded to max total memory limit

pgx data memory limits

What Can Be Configured?

Field Type Description Default
max_per_session_data_memory_rationumbermemory limit for any one session of the PGX engine relative to the user data memory limit1.0
max_per_session_data_memory_sizestringabsolute memory limit for any one session of the PGX enginenull
max_per_user_data_memory_rationumbermemory limit for any one user of the PGX engine relative to the private data memory limit1.0
max_per_user_data_memory_sizestringabsolute memory limit for any one user of the PGX enginenull
max_total_data_memory_rationumbermemory limit across entire PGX engine relative to available system memory0.9
max_total_data_memory_sizestringabsolute memory limit across entire PGX enginenull
max_total_private_data_memory_rationumbermemory limit of private data (includes non-published graphs and PGQL results) relative to total PGX engine memory limit1.0
max_total_private_data_memory_sizestringabsolute memory limit of private data (includes non-published graphs and PGQL results)null
max_total_shared_data_memory_rationumbermemory limit of shared data (includes published graphs and pinned non-referenced graphs) relative to total PGX engine memory limit1.0
max_total_shared_data_memory_sizestringabsolute memory limit of shared data (includes published graphs and pinned non-referenced graphs)null

Examples

Configure Data Memory Limit for Any User

In the example below we configure the max total data memory to not exceed one terabyte, and we each user data should not use more than 100 gigabyte.

{
  "data_memory_limits": {
    "max_total_data_memory_size": "1T", 
    "max_per_user_data_memory_size": "100G"
  }
}

Configure Data Memory Limit per Role

The example below shows how to configure the max data memory limit for users having the role "analyst".

{
  "authorization": [
    {
      "pgx_role": "analyst",
      "pgx_permissions": [
        {
          "grant": "pgx_session_create"
        },
        {
          "grant": "pgx_session_get_published_graph"
        }
      ], 
     "data_memory_limit": "50G"
    }
  ]
}

Configure Data Memory Limit for Pre-loaded Graphs

In the example below we configure the max shared data memory to not exceed 500 gigabyte, this can be used to limit the memory that can be used when pre-loading a graph.

{
  "data_memory_limits": {
    "max__total_shared_data_memory_size": "500G", 
  }
}