> On 7 Apr 2017, at 9:40 AM, Vishnu Prasad <[email protected]> wrote:
> 
> All,
> I am new to mod_wsgi and the entire configurations around related to this. 
> Detailing out the requirement, please do let me know your response.
> 
> 1. I have written a simple python script to handle images which listens on 
> port 8041. There is some custom processing happening here and its not just 
> static rendering. The output of this is a content of type image and bytes is 
> the response.
> 2. I am starting this python script file(application) using command 
> mod_wsgi-express start-server abc.py --threads 20 --process 2 

Are you doing image processing? If you are and it is CPU intensive, then use of 
threads, rather than processes, isn't then best idea.

> 3. I have varnish script that whenever gets any requests for images on 8080 
> routes to this application on port 8041.
> 4. This application is also running another default instance of apache2 which 
> is serving my all other application requests not related to images.

And this is a Python application also hosted on mod_wsgi, but configured 
manually in normal Apache instance rather than using mod_wsgi-express?

> The above setup is working.
> 
> Problem/Help needed:
> 1. I want to configure and run the above application as distinct 
> WSGIDaemonProcess. How do I achieve this ?

If for (4) you are running a Python application hosted on mod_wsgi, you should 
already be using daemon mode as embedded node is generally not recommended as 
explained in:

    http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html 
<http://blog.dscpl.com.au/2012/10/why-are-you-using-embedded-mode-of.html>
> 2. If the above ask is accomplished by  a configuration in default apache 
> httpd.conf (not mod_wsgi httpd.conf) then i also want to know how will apache 
> identify my application vs other applications of mod_wsgi which may be 
> running ? Is it based on server url or ?

How to vertically partition a URL namespace so as to directory subsets of URLs 
to a different daemon process group within the same Apache instance, is 
explained in:

    http://blog.dscpl.com.au/2014/02/vertically-partitioning-python-web.html 
<http://blog.dscpl.com.au/2014/02/vertically-partitioning-python-web.html>
> 3. For the above application, need to have better control over what is loaded 
> in httpd.conf. So, want to load my own httpd.conf including path of log 
> mounts etc. How do I achieve this ?

I don't understand what you mean by this.

You should not be using mod_wsgi-express to generate Apache configuration to 
then use in an existing Apache installation. The mod_wsgi-express instance is 
self contained with a generated configuration. If customisations for that are 
required, most common things can be overridden using the command line options. 
For some special cases you can use --include-file to add additional 
configuration at the end of the generated configuration if necessary.

> 4. Finally, at somepoint if I want to manage the httpd.conf common file 
> across WSGI and my default apache, how do I set up the application specific 
> configurations - through virtualhost section in httpd-vhost.conf or ?

If for the other (4) above the answer is that you are also using a manually 
configure Apache/mod_wsgi, as well as a separate mod_wsgi-express for just one 
subset of URLs, then as per blog on vertically partition, you probably should 
just do it all manually in one Apache/mod_wsgi instance if want to have config 
all in one spot. Personally I would probably use multiple mod_wsgi-express 
instance sitting directly behind varnish or whatever front end you are using. 
The generated configuration from mod_wsgi-express is usually going to be better 
than what many would set up manually as it sets a whole lot of good stuff 
related to timeouts which makes things more robust. When Apache/mod_wsgi is 
manually configured there are no default timeouts set.

Anyway, suggest you read that blog on vertically partition a web application at 
least and clarify things by answering questions above.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to