This might sound like a silly question that is probably just part of the HTTP protocol, but might be important to debugging an issue I'm having.
We have some PHP code that uses the php-curl functions to grab a response from an API and save it. The code works on our dev, and staging servers but breaks when it goes to the load balanced production setup. To test my sanity, I pulled a server off the load balancer and ran it again, it didn't produce errors.
So I suspect it's due to the load balancer. When curl is opened does it say, record the IP of the host for return addressing? Could it be grabbing the IP of the load balancer and then returning to any of the arbitrary servers that doesn't have the connection open waiting for a response?
I've seen that there are a handful of ways to address a specific IP/resource behind a Load Balancer, but haven't seen anything in the order of ensuring that responses return to the initiator.
EDIT Specifics: The production site is hosted on 6 nodes with the exact same code behind 1 load balancer on Rackspace. I have 1% control over what that Load Balancer does (like open ports) so thus my need to determine if it's the issue. The curl code is addressing a Third-Party API that we'll have to consider as a black box (who is probably also Load Balanced).
Code with obfuscations/simplifications:
// Check that we have a Video ID value and it's not empty, check if the created date has changed
if (isset($node->field_video_id['und'][0]['value']) && $node->field_video_id['und'][0]['value'] != '' && $node->created != $node->original->created) {
$result = db_query('SELECT value FROM {livestream_event} WHERE video_id='. $node->field_video_id['und'][0]['value'] . '');
foreach($result as $item) {
$event_id = $item->value;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://<API IP>/livestreamauth.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$token_data = curl_exec($ch);
$token_data = json_decode($token_data);
// use all the data and persist to db once it theoretically gets back.
}