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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:12:10+00:00 2026-06-17T09:12:10+00:00

I’ve deployed a django app with a multithreading module to dotcloud. This thread is

  • 0

I’ve deployed a django app with a multithreading module to dotcloud.
This thread is putting some slow stuff to DB (usually it takes about 3-5 seconds).

When I test it in my virtual enviornment – all works fine.

Here is my dotcloud.yml:

www:
  type: python
  config:
    python_version: v2.7
    uwsgi_enable_threads: true
db:
  type: postgresql
data:
  type: mongodb

Here is my dotcloud log:

[www.0] Process Process-1:
[www.0] Traceback (most recent call last):
[www.0]   File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
[www.0]     self.run()
[www.0]   File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
[www.0]     self._target(*self._args, **self._kwargs)
[www.0]   File "/home/dotcloud/current/usn/views.py", line 416, in sync_countdown
[www.0]     put_current_data_to_db(user_name)
[www.0]   File "/home/dotcloud/current/usn/views.py", line 429, in put_current_data_to_db
[www.0]     current_client = Client.objects.get(user_name=user_name)
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 131, in get
[www.0]     return self.get_query_set().get(*args, **kwargs)
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 361, in get
[www.0]     num = len(clone)
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 85, in __len__
[www.0]     self._result_cache = list(self.iterator())
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 291, in iterator
[www.0]     for row in compiler.results_iter():
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 763, in results_iter
[www.0]     for rows in self.execute_sql(MULTI):
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 818, in execute_sql
[www.0]     cursor.execute(sql, params)
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
[www.0]     return self.cursor.execute(sql, params)
[www.0]   File "/home/dotcloud/env/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
[www.0]     return self.cursor.execute(query, args)
[www.0] DatabaseError: server closed the connection unexpectedly
[www.0]     This probably means the server terminated abnormally
[www.0]     before or while processing the request.
  • 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-17T09:12:11+00:00Added an answer on June 17, 2026 at 9:12 am

    Common way to resolve issues with databases in django threads worked for me – i’ve just added:

    django.db.connection.close()
    

    before starting my thread

    Short explanation:

    Then django forks new thread, the child uses the same connection to DB, as a parent.

    If we close the connection, a child will create a new one.

    • 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'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
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,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

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.