我目前的流量我下面的的图片的上传
和操作
上在 S3存储如下:
My Current flow that I am following for image upload
and its manipulation
on the S3 bucket is as follows:
由于图像尺寸
增大使那些API 响应
time.It需要的 3 秒的API来给予回应按照上述流程为300 KB的图像和30秒为15 MB或更多的图像,同时。
As the image size
increases so those the API response
time.It takes 3 secs for the API to give a response while following above workflow for a 300 KB image and 30 secs for a 15 MB or more image.
我不知道我的流程是否正确。我的要求是,我需要减少我的API响应时间,同时上传15个或更多MB的图像。有人可以给我建议如何实现这一目标?
I don't know if my flow is correct or not. My requirement is that I need to reduce my API response time while uploading a 15 or more MB image. Can somebody suggest me how to achieve this?
修改
要弄清楚,我上传它我从高级REST客户端
(铬插件)把它发送到我的API一个15 MB的文件。该图像文件当前present在我的本地系统。我目前正在 JPG
和 PNG
图像。我想通过的图像的大小调整到两个较大和较小的尺寸降低了宽高比的。我写的API在节点JS它遵循上述流程。
To make it clear I am uploading a single 15 MB file which I am sending it from Advanced Rest Client
(a chrome plugin) to my API. The image file is currently present in my local system. I am currently working on jpg
and png
images. I want to resize the image to both bigger and smaller sizes by reducing the width to height ratio. The API that I Have written is in Node JS which follows the above workflow.
好像上传和下载大图从S3需要花费大量的时间。
Seems like upload and download big image from S3 takes a lot of time.
您可以做一些优化:
尝试使用实:graphicsmagick
包,在普通情况下,它的速度更快了ImageMagick的(最新版本)
请调整大小/前优化运营
上传到S3,并上传在最后一步
Try to use graphicsmagick
package, in common cases it's faster that imagemagick (latest versions)
Make resize / optimize operations before uploading to S3 and upload at last step
如果这是不可能的 - 尽量使用流下载 - 调整 - 上传到S3。只是管道请求流通用模块,并写入管道AWS S3
If it's not possible - try to use Streams for downloading - resizing - uploading to S3. just pipe request stream to gm module and write pipe to AWS S3