Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running

Ubuntu Linux 12.04.1
Kernel and CPU Linux 3.2.0-30-generic on x86_64.
Intel(R) Xeon(R) CPU E31230 @ 3.20GHz, 8 cores

I recently came across this problem. I'm using apache2/php latest and when I run

$url_headers = @get_headers($url);

Inside PHP it would normally take milliseconds to within a second to get the headers. Now recently it can take up to 15 seconds or even timeout.

It has worked great for over a year and recently started doing this. I'm not sure how to go about fixing it, any help would be greatly appreciated.

Thank you

share|improve this question

closed as not constructive by Michael Hampton, HopelessN00b, Scott Pack, Ladadadada, pauska Oct 8 '12 at 15:23

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
You're fetching headers from a remote URL. What led you to believe it's your problem and not their problem? –  Michael Hampton Sep 5 '12 at 8:56
    
My script is running slow. After remove bits of it I found it to be that line causing it. –  Tabatha M Sep 5 '12 at 9:01
    
That doesn't really answer my question. –  Michael Hampton Sep 5 '12 at 9:01
    
I see what you said now it's any header from any URL. –  Tabatha M Sep 5 '12 at 9:03
add comment

1 Answer

up vote 0 down vote accepted

There's all sorts of things that could be causing this. What have you done to investigate?

Most likely it's a DNS or firewall issue. You could check this easily by capturing the packets using wireshark, tcpdump or similar when such a request is being processed (looking up the IP address of the URL before the test may prime the DNS cache).

But that presupposes that you know how to interpret the data.

share|improve this answer
    
No luck cleared the cache on DNS,firewall is fine. –  Tabatha M Sep 5 '12 at 9:18
    
It cleared it self up. –  Tabatha M Sep 5 '12 at 12:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.