Help - Search - Members - Calendar
Full Version: PHP slow network resolution
The Planet Forums > System Administration > Other
iuzzino70
Using php I'm experiencing a very slow performance when resolving names with file_get_contents command. If insteaa off www.domain.com I make the same call using an ip the server is very much faster. Does anybody know why and how to speed up this process?
I have a RH cpanel server.
markcausa
Hmmm, I've experienced the opposite before, where using an IP will slow it down and a domain faster.

I wonder what some of the tech's will say about this.
James Jhurani
The houston resolvers have been kind of slow lately(IS-Unix is cooking something up to fix it). Until then, you may want to just put:

CODE
nameserver 208.67.220.220
nameserver 208.67.222.222


At the top of your /etc/resolv.conf.
iuzzino70
QUOTE (jjhurani @ Feb 29 2008, 10:45 PM) *
The houston resolvers have been kind of slow lately(IS-Unix is cooking something up to fix it). Until then, you may want to just put:

CODE
nameserver 208.67.220.220
nameserver 208.67.222.222


At the top of your /etc/resolv.conf.


Thank you,
I've added them and restarted bind server.
It seems like it has fastened a bit but still there's something that's going on.

I'm downloading some files with curl (images), all from the same server and the time varies from 10 secs to 1 or less. How can you explain this? When will the issue be fixed? How will I be alerted of it?
James Jhurani
QUOTE (iuzzino70 @ Mar 1 2008, 02:38 PM) *
Thank you,
I've added them and restarted bind server.
It seems like it has fastened a bit but still there's something that's going on.

I'm downloading some files with curl (images), all from the same server and the time varies from 10 secs to 1 or less. How can you explain this? When will the issue be fixed? How will I be alerted of it?


One of the drawbacks of grabbing data from remote locations in your PHP scripts, is that you are at the mercy of the remote host(s). If they are lagged, so are you. This is because you have to wait for the pictures to completely download before your page can completely render. Consider hosting the images locally...

I am not quite sure what you mean by "How will I be alerted of it?".
iuzzino70
QUOTE (jjhurani @ Mar 1 2008, 04:33 PM) *
One of the drawbacks of grabbing data from remote locations in your PHP scripts, is that you are at the mercy of the remote host(s). If they are lagged, so are you. This is because you have to wait for the pictures to completely download before your page can completely render. Consider hosting the images locally...

I am not quite sure what you mean by "How will I be alerted of it?".


I mean, how will I know that the houston servers will be up and fast again...

This of the images is only a test. Images are hosted on my server. Also, during tests I'm downloading 3 images at the same time in a cycle. I wouldn't say it's the remote server that's lagged but there's a problem in resolving domains.
The real problem comes when I have to use xml calls for on line reservations... And, as I've tested a bit, the issue is in DNS resolving. That's why if I use ips it's faster.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.