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 942141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:13:30+00:00 2026-05-15T22:13:30+00:00

I am using Amazon S3 service to upload different directories (and the files inside)

  • 0

I am using Amazon S3 service to upload different directories (and the files inside) to different buckets (directory -> bucket).
I am coding in Ruby, and I am using the lib http://amazon.rubyforge.org.

The files are small (about 20KB).

I’d like to upload the directories in parallel (using many threads) but I have to use synchronize around the S3Object.store

@mutex.synchronize do
  S3Object.store(s3_obj_name, open(image_name), bucket_name)
end

If I don’t use synchronize I obtain Net::HTTPBadResponse exception !
So, with synchronize, I lost the advantages of using parallel programming.

Do you have some ideas about how to succeed in the parallel uploading ?

Thank you,
Alessandro DS

  • 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-05-15T22:13:31+00:00Added an answer on May 15, 2026 at 10:13 pm

    It appears that the ruby s3 library you’re using isn’t thread safe: http://rubyforge.org/tracker/index.php?func=detail&aid=8162&group_id=2409&atid=9357

    So your options include:

    • Write a patch for that library to make it thread safe (I’m not a ruby guy, not sure how difficult that would be to do)
    • Find another S3 ruby library that is thread safe (I googled it and didn’t see anything obvious)
    • Write a short ruby script that does a single S3Object.store call, and exec that from your parent ruby script. Then each store() call will be in a separate process and the thread safety issue won’t bite you

    Those options assume you want to stick with ruby. Hope that helps.

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

Sidebar

Related Questions

I am uploading files to s3 using amazons s3 web service. It takes about
I am using PHP with the Amazon Payments web service. I'm having problems with
I'm using Amazon's CloudFront to serve static files of my web apps. Is there
Using Amazon's own client libraries (or alternatives ), you can get listings of available
I'm considering using Amazon's EC2 with a windows instance & SQL. I've seen some
I am just beginning to do research into the feasibility of using Amazon's SimpleDB
Do you know if there is a way of using Amazon SimpleDB with NHibernate?
Due to the lack of clientaccesspolicy.xml, there appears to be problems with using Amazon
I'm contemplating the use of Amazon's CloudFront service to offload my web applications image/file
If I have an app that connects to Amazon's S3 service, is it worth

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.