Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Slow opening socket on ASP with multihomed machine (http://www.velocityreviews.com/forums/t796569-slow-opening-socket-on-asp-with-multihomed-machine.html)

Jim W 10-01-2004 04:23 PM

Slow opening socket on ASP with multihomed machine
 
This is a cross-post from the .NET group since it looks like it may not be
..NET.

New information since the original post is that is the wireless network is
enabled and connected the socket connect time is 4x longer! Disable wireless
and it is back down to just very slow.

Any ideas are appreciated.

-----
I have an ASP.NET app that has very slow connect times using TCPClient, or
the Socket class, or even calling a COM object that uses C socket calls on
certain similar XP SP2 boxes.

On those boxes, if another connection is made within a couple seconds, it is
fast. Running the same C# code in a console app connects instantly.
Unplugging the network cable allows localhost connections to be instant (?!).


Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant, so
it comes down to being ASP.NET on XP Pro on certain boxes. I've includes the
test results and programs. The boxes with the problems are laptops. Is it
an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is greatly
appreciated.

Jim W

Test results:
XPPro ASP to Remote server
First took 6 seconds
Short sleep 1 took 0 seconds
Short sleep 2 took 0 seconds
Long sleep 1 took 4 seconds
Med sleep 2 took 0 seconds

XPPro ASP to Localhost with network connection
First took 6 seconds
Short sleep 1 took 0 seconds
Short sleep 2 took 0 seconds
Long sleep 1 took 4 seconds
Mec sleep 2 took 4 seconds

XPPro ASP to Localhost unplugged
First took 0 seconds
Short sleep 1 took 0 seconds
Short sleep 2 took 0 seconds
Long sleep 1 took 0 seconds
Med sleep 2 took 0 seconds

XPPro .NET console app to localhost, or remote
First took 0 seconds
Short sleep 1 took 0 seconds
Short sleep 2 took 0 seconds
Long sleep 1 took 0 seconds
Med sleep 2 took 0 seconds

W2K Server to local host, or remote
First took 0 seconds
Short sleep 1 took 0 seconds
Short sleep 2 took 0 seconds
Long sleep 1 took 0 seconds
Med sleep 2 took 0 seconds

Pertinent ASP.NET code behind:
....
private void RunTests_Click(object sender, System.EventArgs e)
{
Output.Text = Tester.RunTests( HostName.Text, "<br>" );
}

Pertinent .NET console app code.
....
static void Main(string[] args)
{
System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
}

The tester called by ASP.NET and a .NET console app:

using System;
using System.Net;
using System.Net.Sockets;

namespace SocketTest
{
public class Tester
{
public Tester() {}

public static string RunTests( string server, string eol )
{
string ret = RunTest( server, "First ", eol );

System.Threading.Thread.Sleep( 100 );

ret += RunTest( server, "Short sleep 1", eol );

System.Threading.Thread.Sleep( 100 );

ret += RunTest( server, "Short sleep 2", eol );

System.Threading.Thread.Sleep( 10000 );

ret += RunTest( server, "Long sleep 1", eol );

System.Threading.Thread.Sleep( 5000 );

ret += RunTest( server, "Med sleep 2", eol );

return ret;
}

static string RunTest( string server, string prefix, string eol )
{
DateTime start = DateTime.Now;
TcpClient conn = new TcpClient( server, 80 );
TimeSpan span = DateTime.Now - start;
conn.Close();

return prefix + " took " + span.Seconds + " seconds " + eol;
}
}
}






Manohar Kamath 10-01-2004 04:55 PM

Re: Slow opening socket on ASP with multihomed machine
 
Jim,

I think this has less to do with ASP/ASP.NET, and more with sockets/Wireless
access. Perhaps you can post this as a "sockets issue" to WinXP newsgroups.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Jim W" <JimW@discussions.microsoft.com> wrote in message
news:F53F524B-835B-4B3F-8D95-87ABCAA64356@microsoft.com...
> This is a cross-post from the .NET group since it looks like it may not be
> .NET.
>
> New information since the original post is that is the wireless network is
> enabled and connected the socket connect time is 4x longer! Disable

wireless
> and it is back down to just very slow.
>
> Any ideas are appreciated.
>
> -----
> I have an ASP.NET app that has very slow connect times using TCPClient, or
> the Socket class, or even calling a COM object that uses C socket calls on
> certain similar XP SP2 boxes.
>
> On those boxes, if another connection is made within a couple seconds, it

is
> fast. Running the same C# code in a console app connects instantly.
> Unplugging the network cable allows localhost connections to be instant

(?!).
>
>
> Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant,

so
> it comes down to being ASP.NET on XP Pro on certain boxes. I've includes

the
> test results and programs. The boxes with the problems are laptops. Is

it
> an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is

greatly
> appreciated.
>
> Jim W
>
> Test results:
> XPPro ASP to Remote server
> First took 6 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 4 seconds
> Med sleep 2 took 0 seconds
>
> XPPro ASP to Localhost with network connection
> First took 6 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 4 seconds
> Mec sleep 2 took 4 seconds
>
> XPPro ASP to Localhost unplugged
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> XPPro .NET console app to localhost, or remote
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> W2K Server to local host, or remote
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> Pertinent ASP.NET code behind:
> ...
> private void RunTests_Click(object sender, System.EventArgs e)
> {
> Output.Text = Tester.RunTests( HostName.Text, "<br>" );
> }
>
> Pertinent .NET console app code.
> ...
> static void Main(string[] args)
> {
> System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
> }
>
> The tester called by ASP.NET and a .NET console app:
>
> using System;
> using System.Net;
> using System.Net.Sockets;
>
> namespace SocketTest
> {
> public class Tester
> {
> public Tester() {}
>
> public static string RunTests( string server, string eol )
> {
> string ret = RunTest( server, "First ", eol );
>
> System.Threading.Thread.Sleep( 100 );
>
> ret += RunTest( server, "Short sleep 1", eol );
>
> System.Threading.Thread.Sleep( 100 );
>
> ret += RunTest( server, "Short sleep 2", eol );
>
> System.Threading.Thread.Sleep( 10000 );
>
> ret += RunTest( server, "Long sleep 1", eol );
>
> System.Threading.Thread.Sleep( 5000 );
>
> ret += RunTest( server, "Med sleep 2", eol );
>
> return ret;
> }
>
> static string RunTest( string server, string prefix, string eol )
> {
> DateTime start = DateTime.Now;
> TcpClient conn = new TcpClient( server, 80 );
> TimeSpan span = DateTime.Now - start;
> conn.Close();
>
> return prefix + " took " + span.Seconds + " seconds " + eol;
> }
> }
> }
>
>
>
>
>




Sekhar 10-22-2004 08:08 PM

Re: Slow opening socket on ASP with multihomed machine
 
I had the same issue. I never expected that it was my data in few
dropdowns causing this delay. On the server running as localhost its
super fast but when run on a client, it takes some time for the data
to transfer over to it and hence the dealy.

Sekhar.

"Jim W" <JimW@discussions.microsoft.com> wrote in message news:<F53F524B-835B-4B3F-8D95-87ABCAA64356@microsoft.com>...
> This is a cross-post from the .NET group since it looks like it may not be
> .NET.
>
> New information since the original post is that is the wireless network is
> enabled and connected the socket connect time is 4x longer! Disable wireless
> and it is back down to just very slow.
>
> Any ideas are appreciated.
>
> -----
> I have an ASP.NET app that has very slow connect times using TCPClient, or
> the Socket class, or even calling a COM object that uses C socket calls on
> certain similar XP SP2 boxes.
>
> On those boxes, if another connection is made within a couple seconds, it is
> fast. Running the same C# code in a console app connects instantly.
> Unplugging the network cable allows localhost connections to be instant (?!).
>
>
> Running the same ASP.NET app on W2K or another XP Pro SP2 box is instant, so
> it comes down to being ASP.NET on XP Pro on certain boxes. I've includes the
> test results and programs. The boxes with the problems are laptops. Is it
> an ASP.NET config issue? XP SP2 Security issue? Any ideas/help is greatly
> appreciated.
>
> Jim W
>
> Test results:
> XPPro ASP to Remote server
> First took 6 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 4 seconds
> Med sleep 2 took 0 seconds
>
> XPPro ASP to Localhost with network connection
> First took 6 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 4 seconds
> Mec sleep 2 took 4 seconds
>
> XPPro ASP to Localhost unplugged
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> XPPro .NET console app to localhost, or remote
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> W2K Server to local host, or remote
> First took 0 seconds
> Short sleep 1 took 0 seconds
> Short sleep 2 took 0 seconds
> Long sleep 1 took 0 seconds
> Med sleep 2 took 0 seconds
>
> Pertinent ASP.NET code behind:
> ...
> private void RunTests_Click(object sender, System.EventArgs e)
> {
> Output.Text = Tester.RunTests( HostName.Text, "<br>" );
> }
>
> Pertinent .NET console app code.
> ...
> static void Main(string[] args)
> {
> System.Console.WriteLine( SocketTest.Tester.RunTests( args[0], "\n" ) );
> }
>
> The tester called by ASP.NET and a .NET console app:
>
> using System;
> using System.Net;
> using System.Net.Sockets;
>
> namespace SocketTest
> {
> public class Tester
> {
> public Tester() {}
>
> public static string RunTests( string server, string eol )
> {
> string ret = RunTest( server, "First ", eol );
>
> System.Threading.Thread.Sleep( 100 );
>
> ret += RunTest( server, "Short sleep 1", eol );
>
> System.Threading.Thread.Sleep( 100 );
>
> ret += RunTest( server, "Short sleep 2", eol );
>
> System.Threading.Thread.Sleep( 10000 );
>
> ret += RunTest( server, "Long sleep 1", eol );
>
> System.Threading.Thread.Sleep( 5000 );
>
> ret += RunTest( server, "Med sleep 2", eol );
>
> return ret;
> }
>
> static string RunTest( string server, string prefix, string eol )
> {
> DateTime start = DateTime.Now;
> TcpClient conn = new TcpClient( server, 80 );
> TimeSpan span = DateTime.Now - start;
> conn.Close();
>
> return prefix + " took " + span.Seconds + " seconds " + eol;
> }
> }
> }



All times are GMT. The time now is 04:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.