Solved

Slow response from local application to apache webserver on localhost when network adapter enabled.

Posted on 2016-10-14
8
217 Views
Last Modified: 2016-10-19
Hi,

I have a service written in VB.net 2003 which has been used for some years (mostly on windows XP Pro). The service collects data from a hardware box and then posts data to a php page on  Apache webserver running on the same machine as localhost (127.0.0.1)

Have found an issue where data is transferring at a very slow speed. Normally it can post data as 2 posts a second. When the system with an issue will only post data every 30 to 70 seconds.   This causes the system to grind to a halt.

The php page which receives the post makes connections to the mysql server. I have tested the queries and all are running fast, less then a few mS per query.

Now I have found if I "disable" the ethernet and wifi adapters in Windows , the system recovers and run as normal (2 posts a second).
Then re-enable the adapters and it will run normal for a short period (anywhere from 10secs to 10mins) and then slow up.

The issue machine is a Windows 7 Home 64bit.

I have disable IPV6 on both adapters.
I have removed the ::1 from the hosts file and put in the following 2 lines:
127.0.0.1  localhost  
127.0.0.1 127.0.0.1

I am running Xampp 1.7.7
  + Apache 2.2.21
  + MySQL 5.5.16 (Community Server)
  + PHP 5.3.8 (VC9 X86 32bit thread safe) + PEAR

Apache is using Port 80 (SSL port disabled).
0
Comment
Question by:Nick Price
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 27

Expert Comment

by:BigRat
ID: 41844927
What are you actually using in the service? "localhost" or "127.0.0.1".

I think that you're access to localhost is being "translated" by an external DNS service which times out after a long period and then the default address is used. You might have an automatic postfix on a web address, for example ".com"  so that "google" becomes "google.com" (adds ".com") which would turn "localhost" into "localhost.com" which probably doesn't exist and hence takes ages to reply.
0
 

Author Comment

by:Nick Price
ID: 41846374
HI.
Thank you for the reply.
The service is posting using 127.0.0.1

How do I force it not to look at the DNS for 127.0.01 but everything else still use the DNS?
Internal is required to send emails and sms using a textlocal portal.

my variable  looking like this:   address = "127.0.0.1/Post/post.php"

Regards
Nick



VB.net code which sends the data below.
  Try
            oWeb.Proxy = System.Net.WebRequest.DefaultWebProxy
            oWeb.Proxy.Credentials = System.Net.CredentialCache.DefaultCredentials
            oWeb.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
            Dim nPost As Byte() = System.Text.Encoding.ASCII.GetBytes(SQLdata)
            Dim bRet As Byte() = oWeb.UploadData(address, "POST", nPost)
            out = System.Text.Encoding.ASCII.GetString(bRet)
            oWeb.Dispose()
        Catch ex As Exception
            out = ex.Message
        End Try
0
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 41846412
Have a look at the properties of the LAN connection and those of the IP 4 service. You might find something there which is odd. You might try putting http:// in front of the 127.0.0.1 as well. It is quite clearly something to do with the connectioon because, as you say, the problem disappears when you remove the connection.

You might also try using something like Fiddler or Wireshark to look at the traffic on the line. That might identify the bottle neck.
1
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

Author Comment

by:Nick Price
ID: 41846574
That's for the reply.
I will have to re-install my visual studio to change the service, so it might take me a few days until I come back.

I ran Wireshark, but it doesn't log any information for destination 127.0.0.1, also it will not run without a running network connection.

Regards
Nick
0
 

Author Comment

by:Nick Price
ID: 41846611
Neither Fiddler or Wireshark come us with the posting packs from my windows service. The apache access logs provided little information.
0
 
LVL 27

Expert Comment

by:BigRat
ID: 41846935
I wasn't expecting it to record anything for the destination 127.0.0.1. We are looking for something which is going out which is taking the time. Both Fiddler and WireShark should report DNS accesses.

PS: sorry to be offline this afternoon. We are having terribly unreliable Internet today.
0
 

Author Comment

by:Nick Price
ID: 41847803
Ok, will come back tomorrow with results.
0
 

Author Closing Comment

by:Nick Price
ID: 41850490
Added the http:// in front of the 127.0.0.1 and everything working fine.

Thank you so much.

Regards
Nick
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question