Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8053723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:56:40+00:00 2026-06-05T07:56:40+00:00

I’m using this script with PHP5-CLI to download a file from Amazon S3 to

  • 0

I’m using this script with PHP5-CLI to download a file from Amazon S3 to an EC2 instance, but it’s rather slow (1 minute for 160 MB, about 2 MB/s). Supposedly at least 10 MB/s should be possible. Am I doing something wrong in the code?

require 'aws-sdk/sdk.class.php';

$s3 = new AmazonS3(array(
        'key' => '********',
        'secret' => '******************'
));
$s3->get_object('mahbucket', 'filename.tar.gz', array('fileDownload' => 'downloaded.tar.gz'));

The bucket is in eu-west-1 and the instance in eu-west-1a

(Cross posted to AWS forums)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:56:41+00:00Added an answer on June 5, 2026 at 7:56 am

    Your script looks fine, but I ran into similar issues a while ago, which I wasn’t abled to fix …

    My new approach is using s3cmd for the file transfer between S3 buckets and my EC2 instances. You just have to configure it once and then you’re abled to trigger it via PHP. It’s also more secure because you don’t have to store your AWS credentials inside your script.

    In my opinion the speed is okay:

    user@mothership:~/s3# s3cmd put test.bin s3://data.example.com/test.bin
    
    test.bin -> s3://data.example.com/test.bin  [part 1 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.39 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 2 of 13, 15MB]
     15728640 of 15728640   100% in    0s    15.55 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 3 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.18 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 4 of 13, 15MB]
     15728640 of 15728640   100% in    0s    17.32 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 5 of 13, 15MB]
     15728640 of 15728640   100% in    0s    18.87 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 6 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.58 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 7 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.29 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 8 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.95 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 9 of 13, 15MB]
     15728640 of 15728640   100% in    0s    15.33 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 10 of 13, 15MB]
     15728640 of 15728640   100% in    0s    17.01 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 11 of 13, 15MB]
     15728640 of 15728640   100% in    0s    15.36 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 12 of 13, 15MB]
     15728640 of 15728640   100% in    0s    16.56 MB/s  done
    test.bin -> s3://data.example.com/test.bin  [part 13 of 13, 10MB]
     11256320 of 11256320   100% in    0s    14.15 MB/s  done
    
    user@mothership:~/s3# s3cmd get s3://data.example.com/test.bin test.bin.new
    s3://data.example.com/test.bin -> test.bin.new  [1 of 1]
     200000000 of 200000000   100% in   11s    16.20 MB/s  done
    

    Maybe this article is interesting as well: Network performance within Amazon EC2 and to Amazon S3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
Does anyone know how can I replace this 2 symbol below from the string
I am using parse_ini_file to read the contents of a file however it is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.