I have simple ASP.NET application which just resizes images with ImageResizer and does nothing else. For testing purposes I disabled disk caching, so images are resized on e
I found an answer thanks to @Ben's comment.
The problem is ImageResizer is based on GDI+ (as stated on it's site), which contains locks inside (see this and this posts for details). This is why it works so slowly in single process.
After finding the cause of problem I tried this solution. Referencing WPF assemblies from ASP.NET application is, probably, not a best idea, but it's ok for testing purposes.
Now I get the following results when I perform the same performance testing as in question:
As you can see, now application works much faster. Also it utilizes almost all available CPU resources under high load, as I expected initially.
So, if you process images in your ASP.NET application:
- don't use GDI+ based solution, if you can
- if you have to use GDI+, increase MaxWorkerProcesses in applicaion pool's settings