from the logs:
2940962304 - Sat Nov 18 22:45:17 CST 2017 - - Requesting rate limit data…
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - => Rate Limit returned in 6079ms
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - Checking rate limits…
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - rate_limit_context = 2940962304-UMjs8yZpA12yNpdpl7ak1eEtPWhq8MVmG4s91Hp
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - limit_friends_list = 900
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - remaining_friends_list = 899
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - rate_limit_reset_friends_list = 1511067584
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - Rate limit has not been exceeded. Carry on…
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - Requesting a page of data from twitter…
2940962304 - Sat Nov 18 22:45:23 CST 2017 - - => API response returned in 320ms
2940962304 - Sat Nov 18 22:45:29 CST 2017 - - Requesting rate limit data…
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - => Rate Limit returned in 3932ms
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - Checking rate limits…
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - rate_limit_context = 2940962304-UMjs8yZpA12yNpdpl7ak1eEtPWhq8MVmG4s91Hp
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - limit_friends_list = 900
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - remaining_friends_list = 898
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - rate_limit_reset_friends_list = 1511067584
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - Rate limit has not been exceeded. Carry on…
2940962304 - Sat Nov 18 22:45:33 CST 2017 - - Requesting a page of data from twitter…
2940962304 - Sat Nov 18 22:46:03 CST 2017 - - => API response returned in 30000ms
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - => Rate Limit returned in 121ms
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - Checking rate limits…
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - rate_limit_context = 2940962304-UMjs8yZpA12yNpdpl7ak1eEtPWhq8MVmG4s91Hp
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - limit_friends_list = 900
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - remaining_friends_list = 897
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - rate_limit_reset_friends_list = 1511067584
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - Rate limit has not been exceeded. Carry on…
2940962304 - Sat Nov 18 22:50:56 CST 2017 - - Requesting a page of data from twitter…
2940962304 - Sat Nov 18 22:51:26 CST 2017 - - => API response returned in 30000ms
2940962304 - Sat Nov 18 22:51:46 CST 2017 - - Requesting rate limit data…
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - => Rate Limit returned in 9762ms
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - Checking rate limits…
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - rate_limit_context = 2940962304-UMjs8yZpA12yNpdpl7ak1eEtPWhq8MVmG4s91Hp
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - limit_friends_list = 900
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - remaining_friends_list = 896
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - rate_limit_reset_friends_list = 1511067584
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - Rate limit has not been exceeded. Carry on…
2940962304 - Sat Nov 18 22:51:56 CST 2017 - - Requesting a page of data from twitter…
2940962304 - Sat Nov 18 22:52:26 CST 2017 - - => API response returned in 30001ms
30 seconds latency on the user/lookup endpoint.
6 to 9 seconds latency on rate limit endpoint.
Relevant code:
if($logging){LogEntry(“Requesting a page of data from twitter…”);}
$g_params = array(
“user_id” => $userlist,
“include_entities” => “false”
);
// -------------------------- record API roundtrip time
$_api_start_time = round(microtime(true) * 1000); // ms
// -------------------------- start timestamp
$user_info = $twitteroauth->post(‘users/lookup’, $g_params);
if (isset($user_info->errors)) {
// deal with the error
// ...... error handling stuff .....
} else {
// deal with the data
// -------------------------- record API roundtrip time
$_api_end_time = round(microtime(true) * 1000); // ms
$_api_round_trip = ($_api_end_time - $_api_start_time);
if($logging){LogEntry("=> API response returned in ".$_api_round_trip."ms ");}
// -------------------------- end timestamp
// ...... response handling stuff .....
}
There is nothing going on between the start timestamp and the api call, nor between the api call and the end timestamp. The 30+ second api delays effectively timeout the page load.