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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:16:48+00:00 2026-05-16T10:16:48+00:00

If not whats the maximum while still remaining efficient? I’m creating 14 threads, each

  • 0

If not whats the maximum while still remaining efficient?

I’m creating 14 threads, each of which opens a list of URLs(about 500) creates a new thread for each one, which then downloads it, and adds it to a MySQL db. The MySQL pool size is set to 50.

This is a rake task in RoR.

Would this work better using Kernal#fork or some other method?

  • 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-16T10:16:49+00:00Added an answer on May 16, 2026 at 10:16 am

    Well, since your threads are going to be IO bound, the good news is that both Ruby 1.8 and 1.9 threads will work for this. Ruby 1.8 uses “userspace threads,” meaning no real new OS threads are created when you create new threads in Ruby. This is bad for CPU multitasking, since only one Ruby thread is actually running at a time, but good for IO multitasking. Ruby 1.9 uses real threads, and will be good for either.

    The number of threads you can create really depends on your system. There are of course practical limits, but you probably don’t want to get anywhere near them. First, unless the servers you’re downloaidng from are very slow and your connection is very fast, just a few threads is going to saturate your Internet connection. Also, if you’re grabbing a lot of pages from a single server, throwing 500 requests at it at once from 500 threads isn’t going to do any good either.

    I’d start pretty small: 10 or 20 threads running at once. Increase or decrease this depending on server load, your bandwidth, etc. There’s also the issue of concurrent connections to the MySQL database. Depending on how your tables are set up and how large they are, trying to insert too much data at the same time isn’t going to work very well.

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

Sidebar

Related Questions

Not sure whats going on here, or what could be the integer in this
from here 48 struct snd_card *snd_cards[SNDRV_CARDS]; 49 EXPORT_SYMBOL(snd_cards); I am not getting whats the
I'm not entirely sure whats happened here. I may have messed things up somewhere,
I got this error message and I'm not quite sure whats wrong: Exception in
Whats the common and not so common usage patterns for the C# keywork 'is'.
Whats wrong with my query? ALTER TABLE test_posts ADD sticky boolean NOT NULL default
Can someone please tell me whats wrong with this code. I'm not getting complete
Is there a simple shuffle function for Scala lists? If not, whats the simplest
I'm still working on my binary trees, and the insertion, lookup, maximum, minimum functions
I am seeing a strange thing which is not what I expect as per

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.