{"action":"created","issue":{"url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9373","repository_url":"https://api.github.com/repos/mattermost/mattermost-server","labels_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9373/labels{/name}","comments_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9373/comments","events_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9373/events","html_url":"https://github.com/mattermost/mattermost-server/pull/9373","id":357550711,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNTM2NDkz","number":9373,"title":"MM-10677 memory fix to s3 upload","user":{"login":"zetaab","id":22482503,"node_id":"MDQ6VXNlcjIyNDgyNTAz","avatar_url":"https://avatars2.githubusercontent.com/u/22482503?v=4","gravatar_id":"","url":"https://api.github.com/users/zetaab","html_url":"https://github.com/zetaab","followers_url":"https://api.github.com/users/zetaab/followers","following_url":"https://api.github.com/users/zetaab/following{/other_user}","gists_url":"https://api.github.com/users/zetaab/gists{/gist_id}","starred_url":"https://api.github.com/users/zetaab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zetaab/subscriptions","organizations_url":"https://api.github.com/users/zetaab/orgs","repos_url":"https://api.github.com/users/zetaab/repos","events_url":"https://api.github.com/users/zetaab/events{/privacy}","received_events_url":"https://api.github.com/users/zetaab/received_events","type":"User","site_admin":false},"labels":[{"id":250214574,"node_id":"MDU6TGFiZWwyNTAyMTQ1NzQ=","url":"https://api.github.com/repos/mattermost/mattermost-server/labels/2:%20Dev%20Review","name":"2: Dev Review","color":"eb6420","default":false},{"id":308747687,"node_id":"MDU6TGFiZWwzMDg3NDc2ODc=","url":"https://api.github.com/repos/mattermost/mattermost-server/labels/Setup%20Test%20Server","name":"Setup Test Server","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-09-06T08:34:27Z","updated_at":"2018-09-06T13:59:25Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-server/pulls/9373","html_url":"https://github.com/mattermost/mattermost-server/pull/9373","diff_url":"https://github.com/mattermost/mattermost-server/pull/9373.diff","patch_url":"https://github.com/mattermost/mattermost-server/pull/9373.patch"},"body":"#### Summary\r\nCurrently mattermost is using `-1` size option when using s3 file upload. One writefile function call causes 576MB memory consumption and that can easily lead to server crash. Lets say we have 10 users uploading files at the same time, it takes already 5GB of memory.\r\n\r\nSo this fix is first copying the whole stream to buffer, and with that way we can define how much memory we really need. However, this is not good solution if the files are larger than original 576MB, because then the buffer size is going to be problem. At least for us we have maxfilesize limit lower than 576MB, so that is not problem for us.\r\n\r\n#### Ticket Link\r\nhttps://github.com/mattermost/mattermost-server/issues/8838\r\nhttps://github.com/mattermost/mattermost-server/issues/9078\r\n\r\n#### Checklist\r\n- [x] All new/modified APIs include changes to the drivers\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mattermost/mattermost-server/issues/comments/419103794","html_url":"https://github.com/mattermost/mattermost-server/pull/9373#issuecomment-419103794","issue_url":"https://api.github.com/repos/mattermost/mattermost-server/issues/9373","id":419103794,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTEwMzc5NA==","user":{"login":"mattermod","id":16344077,"node_id":"MDQ6VXNlcjE2MzQ0MDc3","avatar_url":"https://avatars1.githubusercontent.com/u/16344077?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermod","html_url":"https://github.com/mattermod","followers_url":"https://api.github.com/users/mattermod/followers","following_url":"https://api.github.com/users/mattermod/following{/other_user}","gists_url":"https://api.github.com/users/mattermod/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermod/subscriptions","organizations_url":"https://api.github.com/users/mattermod/orgs","repos_url":"https://api.github.com/users/mattermod/repos","events_url":"https://api.github.com/users/mattermod/events{/privacy}","received_events_url":"https://api.github.com/users/mattermod/received_events","type":"User","site_admin":false},"created_at":"2018-09-06T13:59:25Z","updated_at":"2018-09-06T13:59:25Z","author_association":"NONE","body":"`Setup Test Server` label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch)."}}
{"actor":{"display_login":"mattermod"}}