Would a file upload controller gain performance benefits if converted to an AsyncController?
I have a controller action which handles multiple photo uploads (which are uploaded using Plupload). For each file that is uploaded, the controller will do the following:
- Create 7 resized versions of the photo
- Upload these 7 versions to Amazon S3
- Save info about the photo into a database.
The end user of this web app will be uploading as many as 100 hi res (~4mb) photos at a time so performance is a priority.
In this scenario, would I see an increase in performance (i.e. total time spent waiting for the app to handle the uploads) if I changed the controller to an开发者_运维技巧 AsyncController?
It probably won't increase performance but it might offload some worker threads especially while waiting for the upload on the Amazon S3 servers which is a IO bound task and you could benefit from I/O completion ports. As far as the resizing is concerned that's CPU bound task so there's not much you could do about it other than improving the algorithm.
精彩评论