开发者

HttpModule versus WCF service in IIS host

I am wondering what would be the best choice: hosting a WCF http service in IIS or creating a website in IIS and using a HttpModule in it to handle requests?

Or perhaps host the WCF http service in a windows service?

The service/httpmodule only logs the body text of inc开发者_C百科oming post messages, returns nothing.

Good performance for e.g. 300 posts/sec. is crucial.


Whichever way you go, I'm pretty sure that any sort of logging will slow down performance on the server. If you average 300 requests per second, you have that number of threads per second competing for the log file. Some threads will have to wait to get access to the log file, and if enough get queued up, there will be a big delay.

That said, the performance difference between the two would be insignificant - you should make your decision based on your familiarity with the technologies.

WCF does have in-built diagnostics functionality so that you can log messages without writing code (see MSDN), but it takes a bit more effort to learn WCF. The advantage of this is that if you notice logging affecting performance too much, you can turn it off without rewriting the application.

Is your application only logging posts and not doing anything else at all? If so, I would recommend using a database (SQL Server, mySQL etc) instead of the file system - this will deliver much better performance.


I believe performance would be negligible, and the benefits of hosting the service in IIS means you get the additional management and configuration benefits of IIS applications if you need to cater the service specifically.

I guess performance really depends on the workfload the service is handling.

I'd prefer a WCF service over a HttpModule, as WCF wraps up the SOAP processing for you, which you'd have to roll yourself if you're building a module.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜