Solved

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

Posted on 2016-10-14
8
168 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

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

Title # Comments Views Activity
using BGP Attributes 2 83
integration of incident management and linking to CMDB 1 39
Cisco AP to get ip from DHCP 10 73
Running a 2nd company from the same location 3 39
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
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…

808 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