You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To retrieve a single windows desktop one must use the GetWindowsDesktops RPC with a DesktopFilter. The backend implementation does a range read and applies the filter on each desktop even though when the filter is given with a hostID and a name it should only match a single desktop.
In clusters with a large number of desktops this results in excessive CPU consumption to find a single desktop.
Additionally, the GetWindowsDesktops RPC is not paginated, and may result in OOM or exceeding the gRPC message sizes if called in a cluster with a large number of desktops.
Proposal
Modify the GetWindowsDesktops backend method to do a point read if the filter contains a hostID and a name. While this doesn't address the higher level concerns the RPC presents, it will eliminate the excessive CPU consumption during desktop heartbeats and can safely be backported.
Deprecate the GetWindowsDesktops RPC and add a GetWindowsDesktop and possibly a ListWindowsDesktop RPC. The latter may not be necessary since the same can be achieved with the ListResources or ListUnifiedResources RPCs.
The text was updated successfully, but these errors were encountered:
Problem
To retrieve a single windows desktop one must use the GetWindowsDesktops RPC with a DesktopFilter. The backend implementation does a range read and applies the filter on each desktop even though when the filter is given with a hostID and a name it should only match a single desktop.
teleport/lib/services/local/desktops.go
Lines 42 to 67 in 312c829
Each time a desktop is heartbeated via UpsertWindowsDesktop the entire desktop range is read to find the matching host.
teleport/lib/auth/auth_with_roles.go
Lines 6715 to 6725 in 312c829
In clusters with a large number of desktops this results in excessive CPU consumption to find a single desktop.
Additionally, the GetWindowsDesktops RPC is not paginated, and may result in OOM or exceeding the gRPC message sizes if called in a cluster with a large number of desktops.
Proposal
Modify the GetWindowsDesktops backend method to do a point read if the filter contains a hostID and a name. While this doesn't address the higher level concerns the RPC presents, it will eliminate the excessive CPU consumption during desktop heartbeats and can safely be backported.
Deprecate the GetWindowsDesktops RPC and add a GetWindowsDesktop and possibly a ListWindowsDesktop RPC. The latter may not be necessary since the same can be achieved with the ListResources or ListUnifiedResources RPCs.
The text was updated successfully, but these errors were encountered: