I run my webpy apps with the following configuration (based on infos
found at http://webpy.org/cookbook/fastcgi-nginx):

relevant part of my nginx.conf (nginx runs with 1 master and 1
worker):
-----
location / {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_pass 127.0.0.1:8100;
}
-----

how I spawn my fcgi processes:
-----
spawn-fcgi -C 5 -f /path/to/myapp.py -a 127.0.0.1 -p 8100 -P /path/to/
myapppid.pid
-----

myapp.py
-----
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import web

urls = ("/.*", "hello")
app = web.application(urls, globals())

class hello:
    def GET(self):
        return 'Hello, world!'

if __name__ == "__main__":
        web.wsgi.runwsgi = lambda func, addr = None: web.wsgi.runfcgi(func,
addr)
        app.run()
------

wsgi.py of Webpy
-----
def runfcgi(func, addr=('localhost', 8000)):
    """Runs a WSGI function as a FastCGI server."""
    import flup.server.fcgi as flups
    return flups.WSGIServer(func, multiplexed=True,
bindAddress=addr).run()
----


Now my questions:

1) Should I spawn 1 or more myapp.py processes  (with '-C 5' I have 5
workers) ?

2) Should I run flups with multiplexed=True or False (and/or other
options) ?

3) Do I need a different fcgi port for each of my webpy apps (I'm
talking about port 8000 in wsgi.py) ?

BTW Right now my env variables report :
    wsgi.multiprocess: False
    wsgi.multithread: True
but with 'top' I see also my 5 processes

tnx

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to