Solved

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

Posted on 2016-10-14
8
89 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Nick Price
Comment Utility
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
Comment Utility
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
Comment Utility
Ok, will come back tomorrow with results.
0
 

Author Closing Comment

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

Thank you so much.

Regards
Nick
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now