phpoptimizationcurlrackspacecloudfiles

Rackspace cloudfiles API fairly slow


I would like to improve the speed of my script that uploads a small 20kb file to cloudfiles, currently it takes 3 seconds but have seen it take more, up to about 7 seconds.

Basically it does the following...

Tried using cachegrind and webgrind to figure out which part of script is slow and it turns out it's the CURL side of things.

An interesting post here CURL with PHP - Very slow, suggests it may relate to DNS lookups but I'm not 100% sure how to monitor my traffic on Windows, any suggestions?

Do any other users have any suggestions on how to figure out why my CURL request is slow?


Solution

  • I had a similar problem. If you are using Rackspace Servers with Rackspace Cloud files then you want to make sure you are using the proper SNET setting in your code. Example:

    $connect_snet = true;
    $this->conn = new CF_Connection($this->auth, $connect_snet);
    

    This will route connections internal to the Rackspace network; avoiding DNS lookups, etc. Hopefully you'll see improved speed.