Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WSGI Multi processing.
#1
I am using WSGI module for running a RESTful interface application. Application is running fine. When i use a multiple requests simultaneously , from the Run-Console i see these requests are served sequentially causing too long wait times for the requests.
My REST request program(Simulator of 3~5 REST requests) is multi-threaded and i see all the threads are initiated at the same time. I am not sure whether WSGI is doing multi-threading or multiprocessing and need help in steps to find the same.
I use Pycharm IDE over windows operating system.

Currently i have :
from wsgiref.simple_server import make_server

def Main(environ, start_response):
status = '200 OK'
headers = [('Content-Type', 'application/json')]
start_response(status, headers)
<Application Code>

if __name__ == '__main__':
with make_server('', 8000, Main) as server:
print("Serving on port 8000...\nVisit http://localhost:8000\nTo kill the server Ctrol + C..\n")
server.serve_forever()

My reference to WSGI documentation mentions a configuration file like "wsgi.ini" and entries like wsgi.processes = <number> . Not sure whether i have to manually create this file and store in a specific directory to initiate a multiprocessing or threading.

Appreciate your help.

Regards,
Simbha
Reply
#2
Please use proper code tags while posting your thread.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to properly do multi-processing with selenium shinaco 0 444 May-27-2020, 06:42 PM
Last Post: shinaco
  wsgi server ports chrisdb 3 616 Feb-26-2020, 04:24 PM
Last Post: snippsat
  Log WSGI directly to stdout ThomasT 4 1,121 Jan-24-2019, 10:17 AM
Last Post: ThomasT
  Trouble deploying Django (project folder, wsgi.py and libapache2-mod-wsgi) Drone4four 8 3,611 Mar-17-2018, 09:40 PM
Last Post: Drone4four
  Python wsgi example: problem with javascript imonike 12 5,822 Jun-19-2017, 03:27 PM
Last Post: imonike

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020