Significant slowdown in a Windows service from .NET 1.0 to .NET 2.0

I recently upgraded a .NET 1.1 application to .NET 2.0 using nothing but the automatic upgrade of the solution. The service continued to run, but the socket performance is really slow.

The service uses UDP socket communications (blocking), and was gathering data from printers and copiers using the SNMP protocol (over UDP).

Debugging shows that it takes a LONG time for a packet to arrive at the application layer after it has been received by the network interface.

Typically, the service would make a request, and would receive a response within 500 ms. Now, with .NET 2.0 it takes up to several minutes.

There appears to be something trivially wrong, but I wouldn't know where to start.

To be certain of this, I run the service on the same machine, once under .NET 1.1, and under .NET 2.0.

Any help would be appreciated.

[868 byte] By [ShripathiKamath] at [2007-12-24]
# 1

Ok, as it turns out the reception was not slowed, just appeared to be so.

What really was causing the delay was the use of DNS resolution in the application code. In .NET 1.1, the call in the application code was almost instantaneous, but was taking a long time in .NET 2.0.

I think that this issue has been addressed and described in some articles, but I cannot seem to locate it. I'd appreciate it if someone to whom this seems familiar could post a link or two to any articles that might shed light on the behavior.

For the moment I implemented a cache for the DNS lookup and it helped me get past the slowness issue.

ShripathiKamath at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2

Hi shripathi,

If you are able to overcome the perfomance slowdown caused by DNS lookup please let me know. I am facing a major problem because of the DNS lookup. If you have any stop-gap solution also please let me know. Please mail to rajesh.govindasamy@gmail.com

RajeshGovindasamy at 2007-8-31 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified