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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:26:39+00:00 2026-06-10T08:26:39+00:00

In one model I’ve got update() method which updating few fields and creates one

  • 0

In one model I’ve got update() method which updating few fields and creates one object of some other model. The problem is that data I use to update is fetched from another host (unique for each object) and it could take a moment (host may be offline, and timeout is set to 3sec). And now, I need to update couple of hundred objects, 3-4 times per hour – of course updating every one in a row is not an option, because it could take all day.
My first thought was split it up for 50-100 threads so each one could update its own part of objects. 99% of update function time is waiting for server respond (there is few bytes of data only, so pings are the problem), I think the CPU won’t be a problem, I’m more worried about:

  • Django ORM. Can it handle it? Getting all objects, splitting it up, and updating from >50 threads?
  • Is it a good idea to solve this? If it is – how to do it and don’t screw a database? Or maybe I shouldn’t care about so little records?
  • If it isn’t a good way, how to do it right?
  • 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-10T08:26:41+00:00Added an answer on June 10, 2026 at 8:26 am

    You can perform actions from different thread manually (eg with Queue and executors pool), but you should note, that Django’s ORM manages database connections in thread-local variables. So each new thread = new connection to database (which will be not good idea for 50-100 threads for one request – too many connections). On the other hand, you should check database “bandwith”.

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

Sidebar

Related Questions

I got a simple problem in SQLAlchemy. I have one model in a table,
I've got a field in one model like: class Sample(models.Model): date = fields.DateField(auto_now=False) Now,
I have a multi step form which uses one model object and I need
I have a problem trying to update an attribute of one model using the
I want to create one new model class, which will be extended in all
Here is my one model.. CardSignup.rb def credit_status_on_create Organization.find(self.organization_id).update_credits end And here's my other
Is it possible to override the to_sentence method just for one model in my
I've one model, which has several(6) linked tables. Most of times, I use this
I am currently running into a problem of connecting one model to another. Basically
I have a few models I'm trying to relate. One model is Item ,

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.