RE: Solving problems

This morning I learned some more about the issues described in my previous post: Solving problems.

The BIG-IP load balancer we are using has a feature called OneConnect. This feature can increase network throughput by managing connections between the BIG-IP and the backend servers more efficiently.

After browsing the support pages over at f5.com I found a document that had an overview of OneConnect. The document states that the FastHTTP profile (a profile in the BIG-IP) uses an implementation of OneConnect that transforms Connection: close headers to Xonnection: Close. fritz (the Varnish that BIG-IP was using) was using the FastHTTP profile, and that is why it returned these Xonnection: close headers. I thought this was a bug, but it is actually a feature (it’s not a bug, it’s a feature).

I guess the cURL library used from PHP in the Dr. Front application on appfront does not understand what this header is and keeps a connection open to the BIG-IP. The connection between the BIG-IP and wildbill (the backend server that Dr. Front did some HTTP HEAD requests to) is probably closed so Dr. Front never receives the data it should. I thought cURL had some sort of timeout pr. default but it doesn’t seem like this is the case.

I took a quick peek at the part of the code in Dr. Front that does these HEAD requests:

// ...
$ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
 curl_setopt($ch, CURLOPT_NOBODY, true);
 $data = curl_exec($ch);
// ...

There is nothing in that code that has anything to do with timeouts. cURL has an option called CURLOPT_TIMEOUT that can be used for this. One line of code should be added before the call to curl_exec:

curl_setopt($ch, CURLOPT_TIMEOUT, 10);

This line would then tell curl_exec that it had at least 10 seconds to do it’s magic. I have not tested this yet but once the developer of Dr. Front is back from his vacation I’ll get him to try this in combination with the Varnish that returns the Xonnection: close header.

Resources:

Advertisements
This entry was posted in PHP, Technology, Work related and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s