WIP: Memory efficient method of getting Mime Types
We have been getting OOM messages from finfo
calls that get the mime type from a file buffer.
See #1120 for full details.
This MR touches a number of different API endpoints for fetching and also changes the S3 Service write
method so affects any media file upload.
/api/fs/v1/avatars
/api/fs/v1/banners
/api/fs/v1/paywall
/api/fs/v1/thumbnail
<- This was producing the most errors given the number of times it gets hit
Some steps for reproduction:
- Try to post a media file that exceeds 13M in size to the nesfeed.
-
POST /api/v1/media
request will return a 200 OK status withFatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 146703512 bytes) in /var/www/Minds/engine/Core/Storage/Services/S3.php on line 67
as the response
When this gets to staging, accessing the following URL should be successful, currently fails in production: https://www.minds.com/fs/v1/thumbnail/1026508015016828928/xlarge
added scoped labels
marked as a Work In Progress
changed the description
added 1 commit
- Developer
mimeType: image/gif S3 Write: https://minds-sandbox.s3.amazonaws.com/2019/07/11/996163850711601168//image/0/1041744968147800081/master.jpg mimeType: image/jpeg S3 Write: https://minds-sandbox.s3.amazonaws.com/2019/07/11/996163850711601168/image/0/1041744968147800081/small.jpg mimeType: image/jpeg S3 Write: https://minds-sandbox.s3.amazonaws.com/2019/07/11/996163850711601168/image/0/1041744968147800081/medium.jpg mimeType: image/jpeg S3 Write: https://minds-sandbox.s3.amazonaws.com/2019/07/11/996163850711601168/image/0/1041744968147800081/large.jpg mimeType: image/jpeg S3 Write: https://minds-sandbox.s3.amazonaws.com/2019/07/11/996163850711601168/image/0/1041744968147800081/xlarge.jpg
Please register or sign in to reply