Skip to content

Instantly share code, notes, and snippets.

@n8kowald
Created January 16, 2013 10:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8kowald/4546101 to your computer and use it in GitHub Desktop.
Save n8kowald/4546101 to your computer and use it in GitHub Desktop.
Investigate slowness with PHP
$ch = curl_init('http://path/to/sanfrancisco/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
$info will return an array including elements for
total_time,
namelookup_time,
connect_time,
pretransfer_time,
starttransfer_time and
redirect_time.
From these you should be able to work out whether it's the dns, request, the actual soap server or the response that's taking up the time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment