Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-10-14
8
Medium Priority
?
227 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 2000 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

670 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