Skip to content

Calls to getContainer take twice as long as a raw curl call #540

@nickjenkin

Description

@nickjenkin

I can give you an xhprof dump if required, it looks like this might be guzzle related, however this is pretty annoying. Strangely we do not seem to be having issues with Container->getObject() calls

(maybe also for the rackspace side: why is this api so slow in general?)

[vagrant@localhost log]$ time mr rackspace test-speed-curl
Operation Successful

real 0m6.887s
user 0m5.032s
sys 0m0.455s
[vagrant@localhost log]$ time mr rackspace test-speed
Operation Successful

real 0m12.610s
user 0m1.997s
sys 0m1.743s

function cf_test_speed() {
    $cf = Cloudfiles_client();
    $cf->getContainer('PTS');
}

function cf_test_speed_curl() {

    $cf = Cloudfiles_client();
    $client = $cf->getClient();
    $token = $client->getToken();

    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_URL, "https://storage101.ord1.clouddrive.com/v1/MossoCloudFS_XXXX/PTS");
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);
    curl_setopt ($ch, CURLOPT_USERAGENT, 'rk');

    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'X-Auth-Token: ' . $token));
    $content = curl_exec ($ch);
    curl_close ($ch);

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions