I'm at a bit of a loss and I'm trying to decide if I need to rework our api service to run in IIS instead of being self hosted to test if my performance issue are some self hosted configuration issues.
The web api app run as a windows service, there is no MVC pages it's just api endpoint. One endpoint I'm using for stress testing returns a static 137 byte response, basically it's the service version and links to the other supported endpoints.
My test is pretty simple install application onto and AWS C4x8 large hit the endpoint with a 2000 request per second for 1 min. This works fine response rates are >50ms after an initial startup cpu usage goes up 4-6%. So my assumption is I can increase the
request rate to consume more CPU time. That's where problems start at 4000 request per second no steady state is achieved, avg response time is about 2s and there is about 2-6% failure rate in the responses consisting of timeouts or network errors. The odd
part is cpu usage in this case doesn't increase visibly during this test run.
I've been investigating changing the defaults ServicePointManager and ThreadPool settings as possible configuration issue, but from research it seems like some of this is optimized by IIS already. So would it be worth figuring out how to not self host and use and IIS host for our api application?