Skip to content

Conversation

@ryanclark
Copy link
Member

@ryanclark ryanclark commented Oct 16, 2025

This changes the session recording processor to upload thumbnails as soon as they're generated, instead of keeping them all in memory and uploading at the end.

To do this, a pipe is created and passed through to UploadMetadata, and the thumbnails are marshalled into the pipe writer on creation. To accommodate this, the session duration needed to be known before processing. The start/end event times are tracked during the session upload (using the last print/resize event time if there is no end event), and passed through at the end when it is processed

I had to modify the GetMetadata to handle thumbnails/metadata being stored in the metadata protobuf file in any order

This + the previous PR takes the total memory allocation of ProcessSessionRecording from ~257mb to ~283kb, a 930x reduction

#60266 took it from 257mb (325mb total minus 68mb for upload) to ~14mb (62mb minus 48mb for upload)

This takes it from 14mb to 283kb (24.86mb usage minus 24.58mb for upload)

image

@ryanclark ryanclark added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v18 labels Oct 16, 2025
@github-actions github-actions bot requested review from rana and smallinsky October 16, 2025 12:54
@github-actions github-actions bot added audit-log Issues related to Teleports Audit Log size/sm labels Oct 16, 2025
@ryanclark ryanclark force-pushed the ryan/write-thumbnails-on-creation branch from 1bb991c to d6a9e5f Compare October 16, 2025 13:05
@ryanclark ryanclark force-pushed the ryan/write-thumbnails-on-creation branch from 16a7122 to 2b9b927 Compare October 22, 2025 06:07
@ryanclark ryanclark requested a review from tigrato October 22, 2025 07:04
@ryanclark ryanclark force-pushed the ryan/write-thumbnails-on-creation branch from 9753342 to d736fcd Compare October 23, 2025 02:47
@ryanclark ryanclark added this pull request to the merge queue Oct 23, 2025
Merged via the queue into master with commit ba174cf Oct 23, 2025
41 checks passed
@ryanclark ryanclark deleted the ryan/write-thumbnails-on-creation branch October 23, 2025 03:33
@backport-bot-workflows
Copy link
Contributor

@ryanclark See the table below for backport results.

Branch Result
branch/v18 Failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit-log Issues related to Teleports Audit Log backport/branch/v18 no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants