Rackspace Coudsites has a 30 second timeout limit at the Load balancer and there is not much we can do that I know of to change that.
https://www.rackspace.com/knowledge_center/article/connection-timeout-error-message-on-cloud-sites
The part of the code that is timing out is a call to see if the remote files need to be pulled back down to the local. I am personally using this 1-way (posting TO the CDN) and do not need the 2-way sync and so I commented out the code to see if any files need to be pulled back down and now it runs.
WARNING: If you delete files from local, you will not be able to turn that feature off and get the files to auto-pull back down. If you ever need those files again, you will have to grab them with CyberDuck or similar.
line 275 – comment
//$remote_objects = $_SESSION['cdn']->get_cdn_objects(true);
Then again around line 290 – the note above said line 284, but we may be on different versions. I am using version 1.3.1 of the plugin
// Check remote files needing DOWNloaded
//foreach ($remote_objects as $cur_remote_object) {
// if (!in_array($cur_remote_object, $local_objects) && $cur_remote_object['fs'] > 0) {
// $cdn_url = (isset($_SESSION['cdn']->api_settings->use_ssl)) ? get_cdn_url('ssl') : get_cdn_url();
// $cur_remote_object['fn'] = $cdn_url.'/'.$cur_remote_object['fn'];
// $objects_to_download[] = $cur_remote_object;
// $objects_to_download[] = ''
// }
//}
If anybody can figure out how to get this script to run faster or return ajax updates so that the load balancer sees activity, that would be a huge help.