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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:32:25+00:00 2026-06-05T08:32:25+00:00

I am developing an application with the bottlepy framework. I am using the standard

  • 0

I am developing an application with the bottlepy framework. I am using the standard library WSGIRefServer() to run a development server. It is a single threaded server.

Now when going into production, I will want to move to a multi-threaded production server, and there are many choices. Let’s say I choose CherryPy.

Now, in my code, I am initializing a single wsgi application. Other than that, I am also initializing other things…

  • Memcached connection
  • Mako templates
  • MongoDB connection

Since standard library wsgiref is a single threaded server, and I am creating only a single wsgi app (wsgi callable), everything works just fine.

What I want to know is that when I move to the multi-threaded server, how will my wsgi app, initialization code, connections to different server, etc. behave.

  • Will a multi-threaded server create a separate instance of wsgi app for every thread. And will a new thread be spawned for each new request (which then means a new wsgi app for each request)?

  • Will my connections to memcached, mongoDB, etc, be shared across threads or not. What else will be shared between threads

  • Please explain the request-response cycle for a threaded server

  • 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-05T08:32:27+00:00Added an answer on June 5, 2026 at 8:32 am

    In general your application is using wsgi compliant framework and you shouldn’t be afraid of multi-threaded / single-threaded server side. It’s meant to work transparent and has to react same way despite of what kind of server is it, as long as it is wsgi compliant.

    Every code block before bottle.run() will be run only once. As so, every connection (database, memcached) will be instantiated only once and shared.

    When you call bottle.run() bottlepy starts wsgi server for you. Every request to that server fires some wsgi callable inside bottlepy framework. You are not really interested if it is single or multi -threaded environment, as long as you don’t do something strange.

    For strange i mean for instance synchronizing something through global variables. (Exception here is global request object for which bottlepy ensures that it contains proper request in proper context).

    And in response to first question on the list: request may be computed in newly spawned thread or thread from the pool of threads (CherryPy is thread-pooled)

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

Sidebar

Related Questions

I am developing application using Entity Framework. When i'm in debugging mode my test
I'm developing application using VC++ 6. I have a 3rd party DLL. This library
I'm developing application using Grails framework and I'm having problems with hasErrors when invoked
I am developing application application using C++ VS 2008. Now I need to either
I'm developing application WinForms .net 4.0 using C# and the backend is SQL Server
I am developing application as stand alone single system till now . Now i
I'm developing application for android by using flex. That app should read sms from
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
I am developing application using phonegap in eclipse for android .I have created folder
I am developing application for iPhone environment for 1 year from now,In a recent

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.