Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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