none
Performance IIS VS C# socket application RRS feed

  • Question

  • I wrote a small very basic socket server in C# and compared performance to IIS. IIS seems to be around 2 times faster no matter the C# implementation.

    How is IIS so fast and how can I make my C# code competitive (if at all)?

    Friday, April 27, 2018 8:25 AM

All replies

  • This isn't really a question we can answer as we don't have access to the IIS code. IIS has been optimized over the years to reuse connections, optimize calls, use low level connections to the OS, etc. You aren't going to be able to write a simple socket app in C# that is going to be able to keep up with it. At least not without a lot of work and probably more than just a single person helping.

    If you need an HTTP server then use the IIS (for .NET framework) or perhaps Kestrel (for .NET Core). Writing your own, other than for academic purposes, isn't a good use of your time.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, April 27, 2018 1:57 PM
    Moderator
  • Hello exstud,

    For a popular OOP language, you could reference with Tomcat source code for study purpose.

    Best Regards,

    Neil Hu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 30, 2018 7:47 AM
    Moderator