Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetResponses* - memory problems / optimization #9

Open
m-delfino opened this issue Jul 12, 2022 · 1 comment
Open

GetResponses* - memory problems / optimization #9

m-delfino opened this issue Jul 12, 2022 · 1 comment

Comments

@m-delfino
Copy link

GetResponses* methods cause out of memory problems on small instances when downloading responses for large studies (a combination of survey size + number of participants + number of responses).

The main reason is the generation of the entire json/csv file in memory:

buf := new(bytes.Buffer)

The json/csv generation should be done in chunks to avoid out of memory errors, as final buffer is already streamed, eg:

return StreamFile(stream, buf)

@phev8
Copy link
Contributor

phev8 commented Jul 12, 2022

You can very easily download the data in chunks as well. While to methods let you download the whole dataset, you can also adjust your query parameters to download data that actually fit in memory.
Or if you really plan to download the whole dataset, you need to use servers with larger memory.

Since there are existing workarounds that should work well, this is a low prio issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants