Solved

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

Posted on 2016-10-14
8
127 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
  • 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
 

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now