IIS 8.5 single worker process vs Web Garden performance

前端 未结 1 1058
太阳男子
太阳男子 2021-01-05 11:58

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

相关标签:
1条回答
  • 2021-01-05 12:43

    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:

    • single worker process, 1 concurrent client: ~90ms
    • single worker process, 10 concurrent clients: ~120ms
    • single worker process, 40 concurrent clients: ~190ms
    • single worker process, 60 concurrent clients: ~400ms
    • single worker process, 80 concurrent clients: ~630ms

    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
    0 讨论(0)
提交回复
热议问题