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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:46:37+00:00 2026-06-08T08:46:37+00:00

Say I have a Flask application, served by uWSGI using multiple processes, like: uwsgi

  • 0

Say I have a Flask application, served by uWSGI using multiple processes, like:

uwsgi --socket 127.0.0.1:3031 --file flaskapp.py --callable app --processes 4

And my Flask app is organized like this:

/flaskapp
    app.py
    /db
        __init__.py
        somefile.py
        somefile2.py
        ...

And I’m using boto to connect to DynamoDB. The __init__.py file is empty, and each somefilexxx.py file begins something like this:

db = boto.connect_dynamodb()
table = db.get_table('table')
def do_stuff_with_table():

I don’t use threads in the app, and I don’t think uWSGI uses threads unless I explicitly enable them with --threads. Does this setup make sense? Are there any threading issues I have to worry about with urllib (you might guess I know less than nothing about threads…)?

Alternatively, would it make more sense to call connect_dynamodb() in the __init__.py file and only load the tables in the somefile.py files?

  • 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-08T08:46:38+00:00Added an answer on June 8, 2026 at 8:46 am

    Since you haven’t enabled threads in uWSGI (see: --enable-threads, --threads) there’s no Python threading going on here (in Boto or otherwise.)

    I would recommend using --lazy, which will cause your app to be loaded in each worker post-fork. Then you can simply rely on that behavior to ensure each worker has the appropriate connections/pools/etc. available without the concerns of shared state.

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

Sidebar

Related Questions

Say we have deep hashes like: b = {1 => {2 => {} },
Say i have a few fields like the following: abd738927 jaksm234234 hfk342 ndma0834 jon99322
I have a small third party flash application I'd like to incorporate in my
Let's say I have a resource file which exports mc1 with 4 frames in
I have a following application I want to run from a flash drive, say
Suppose I have a flash application; let's say a chess game. The user is
I'm using Flash Builder 4.6. As a simple example, say I have the following
Say I have two routes set up with Flask: app.add_url_rule('/example', view_func = example.Index.as_view('example')) app.add_url_rule('/example/<string:example_key>',
Let's say I have a flash video streaming website, what are some ways in
Let's say we have two flash objects on the same html page. I want

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.