Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unable to use python multiprocessing on Apache2.4 Windows (Terminated process)

30 views
Skip to first unread message

barud...@gmail.com

unread,
Apr 3, 2020, 6:36:16 AM4/3/20
to
I am using flask (with Python2.7.8) application hosted on Apache24 (v2.4.16 Win32) on Windows. I have used python multiprocessing library and Using Process to submit a process. A sample code is given as below:


START

file a.py
====================================
def task1(a,b,c):
# doing task here

END


START

file b.py
===========================================
from multiprocessing import Process
from a import task1

class B(object):
def __init__(self):
#initializaing variables

def call_task(self):
Process(target=task1, args=(1,2,3)).start()

END




This code is working as expected when I am executing this with flask server. (creating python process and creating python child procecss of main process while calling Process(...).start())

But when I am executing the same code with Apache server by creating virtual host. The same code does create process but it does not execute and is already in Terminated state. (both parent and child process are httpd.exe processes).

I have tried to make changes in mpm config of Apache but it did not work or I could not configure it as expected. My current mpm config is as below.


<IfModule mpm_winnt_module>
ThreadsPerChild 150
MaxRequestsPerChild 100
TimeOut 60
MaxConnectionsPerChild 10
</IfModule>

Also I am unable to find any mpm module in modules folder in Apache. Any suggestions in order to make it work on Windows + Apache?
0 new messages