I have an application that takes a bunch of data and processes it in a series of loops that are very time consuming. The end result must be accessible through the HTTP API. I decided to create a core library that does the processing, and an ASP.NET application that starts processes in new threads. There are 4 threads in the main library that process objects from queues.
However, this turns out to be much slower than just starting processing in a simple console application. In my console application, processing takes about 13-20 seconds per cycle, averaging about 17 seconds, in my ASP.NET application, processing takes 13-350 (yes three hundred and fifty) seconds, averaging about 45 seconds. The time for each cycle varies greatly in my ASP.NET application.
Is there any obvious performance using the ASP.NET framework that I skipped? I have disabled utilization, and during processing there are several requests, if any. Does this have anything to do with collecting thread or debris? I suspect the latter, since most loops run fast enough, while some loops are extremely slow, which destroys my total processing time.
Should I move away from ASP.NET and try to implement an HTTP listener in my console application or rebuild it into a Windows service? Any ideas?
source share