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

  • Home
  • SEARCH
  • 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 9115187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:22:16+00:00 2026-06-17T04:22:16+00:00

It’s taking ~7.5 seconds to download a 700 KB image file from AWS S3.

  • 0

It’s taking ~7.5 seconds to download a 700 KB image file from AWS S3.

I wrote this method to download an image from AWS S3:

+ (UIImage *)downloadImageFromPath:(NSString *)path
{
    NSDate *methodStart = [NSDate date];

    S3GetObjectRequest *getObjectRequest = [[S3GetObjectRequest alloc] initWithKey:path withBucket:AWS_BUCKET];

    AmazonS3Client *s3 = [[AmazonS3Client alloc] initWithAccessKey:ACCESS_KEY_ID withSecretKey:SECRET_KEY];

    S3GetObjectResponse *response;
    @try
    {
        response = [s3 getObject:getObjectRequest];
    }
    @catch(NSException* ex)
    {
        return [UIImage imageNamed:@"blank.jpg"];
    }

    NSData *data = response.body;
    UIImage *image = [UIImage imageWithData:data];

    NSDate *methodFinish = [NSDate date];
    NSTimeInterval executionTime = [methodFinish timeIntervalSinceDate:methodStart];
    NSLog(@"executionTime = %f", executionTime);

    return image;
}

I just added code at the beginning and end to time the method.

As I mentioned above, it’s taking ~7.5 seconds to complete.

I’m running it in the background with GCD with priority DISPATCH_QUEUE_PRIORITY_HIGH, and there’s nothing else in the queue when it runs.

Anyone know why it’s taking so long? Would be happy to provide more info.

  • 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-17T04:22:17+00:00Added an answer on June 17, 2026 at 4:22 am

    This is a known problem, S3 alone is slow when it comes to the upload and download of images.

    Well, it actually isn’t a problem when you enable CloudFront and use other AWS services.

    What you are looking for is the Cloudfront CDN from Amazon. You can specify an origin (that would be your S3 bucket in your case) and then your files will be distributed to all the Amazon Cloudfront edge locations worldwide. Check out their FAQ and the list of edge locations.

    You would upload to a central server, where majority of your users would be (estimation). And download from a signed URL in which directs you to a server closest to the user that contains a copy of your bucket… You can also cache the images on the servers to make uploading and downloading faster.

    Also, I am not sure how you determine path (the key), but if you are listing keys from S3 buckets, stop that! Its slow! You should use DynamoDB or SimpleDB, both alternatives to storing small datasets, DynamoDB is super fast but doesn’t really have query options, you can store all keys into DynamoDB with a certain format and match them.

    You could use SimpleDB and store all your keys with relevant attributes (properties) and query SimpleDB using SELECT expressions similar to SQL — but a slightly different syntax

    There are a lot of things you can do to optimize S3!

    If you need detailed steps on everything to do, I will do it if you put a bounty on the question. Its not easy picking this up from the documentation but could take me hours to write as well, and I have school!

    After following all these steps, I reduced ~8 seconds to almost the snap of a thumb!

    • 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 am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,

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.