Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Optimization : If the content is already scanned, don't create a temporary file #52

Open
jdauphant opened this issue Sep 3, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jdauphant
Copy link

jdauphant commented Sep 3, 2021

Is your feature request related to a problem? Please describe.
When the content scanner have a lot of pressure, the creation of tempories files for all download request generate lot of IO and can saturate the server.

Describe the solution you'd like
When the content has already been scanned, we can skip the creation of a tempory file and return the result from the media repository request (the content scanner will act like a http reverse proxy).

Describe alternatives you've considered
An another solution we have considered is to use an in memory disk (but we are limited by the size of the memory).

Additional context
I think this change should append here :
https://github.com/matrix-org/matrix-content-scanner/blob/v1.6.3/src/handlers.js#L128
In case if (cachedReport.scanned && cachedReport.clean) we don't use tempory file.

@jdauphant jdauphant changed the title Optimization : If the content is already scanned, don't create a tempory file Optimization : If the content is already scanned, don't create a temporary file Sep 15, 2021
@erikjohnston erikjohnston added the enhancement New feature or request label Sep 22, 2021
@babolivier babolivier self-assigned this Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants