Do these timings for the RackSpace PHP SDK seem about right?

31 views Asked by At

I'm using the RackSpace PHP SDK to upload some HTML to a container.

This script without using the SDK, finishes in roughly ~0.1 seconds. Using the SDK, it's between 1.5 - 2.5 seconds. All I'm doing with the SDK is.

  1. Connect using the username and API key.
  2. Get an instance of objectStoreService.
  3. Set a container.
  4. Upload data to a file.

The largest of the files uploaded at the moment, is 212kb.

Does that seem about right, that doing those 4 operations is taking around 1.4 - 2.4 seconds?

1

There are 1 answers

0
matiu On BEST ANSWER

I have found uploading to cloud files is usually slower than one expects, so you're probably looking at realistic times.

The bottle necks in the cloud files library are:

  • When you login with the username and api key, it returns a token that lasts 24 hours. If you can you should see if you can keep that token, to save an extra API call: http://docs.php-opencloud.com/en/latest/services/identity/tokens.html

  • When you upload a file, it doesn't report 202 OK until it has properly stored the file. The storage backend uses openstack swift, which breaks files into blocks, then each block must be saved on a majority of servers; with Rackspace, I heard each block is saved on 3 servers, so the 'upload' won't return until every block of the file is on at least 2 servers. The way to get around the uploading delay, is to do it asynchronously, or with extra processes uploading multiple files at a time. I don't know how to do it in php without having a secondary and other processes save the files for you.

  • Always use SNET (service net) when you're uploading from inside the same datacenter as the cloud files service