Luc,

You might look into using uWSGI's Dynamic Virtualenv feature.  It basically
lets you configure multiple nginx virtualhosts (each passing through the
virtualenv root and wsgi script) and point it at a single uWSGI instance...
uWSGI takes care of loading each app on the fly.

I've been using it recently with success - although I haven't put the system
under any heavy traffic.  I think Roberto will agree that it is relatively
new and untested, but it might be an alternative for you.

I can post some sample configurations if you are interested.

Cheers,
James

On Fri, Sep 17, 2010 at 8:27 AM, Luc Stepniewski
<[email protected]>wrote:

> Hello,
>
> I'm trying (without success) to launch several wsgi applications
> (Flask) using the new .ini syntax.
> I know I can use the command "uwsgi --ini myconf.ini:app1",  to launch
> each application, but can I do just one command to launch all of them?
> My uwsgi.ini file is the following:
>
> # cat uwsgi.ini
> [trend]
> socket = /opt/base/sockets/uwsgi-trend.socket
> pythonpath = /opt/base/apps/module-trend/wsgi_app
> callable = application
> processes = 4
> master = true
> module = wsgihandler
> harakiri = 30
> chmod-socket = 666
>
> [foobar]
> socket = /opt/base/sockets/uwsgi-foobar.socket
> pythonpath = /opt/base/apps/module-foobar/wsgi_app
> callable = application
> processes = 4
> master = true
> module = wsgihandler
> harakiri = 30
> chmod-socket = 666
>
>
> I tried to launch uwsgi with "uwsgi --ini uwsgi.ini", but I get:
>
> # uwsgi --ini uwsgi.ini
> *** Starting uWSGI 0.9.6.1 (64bit) on [Fri Sep 17 17:26:57 2010] ***
> compiled with version: 4.4.3
> Python version: 2.6.5 (r265:79063, Apr 16 2010, 14:15:55)
> [GCC 4.4.3]
> uWSGI running as root, you can use --uid/--gid/--chroot options
>  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
>  *** WARNING: you are running uWSGI without its master process manager ***
> your memory page size is 4096 bytes
> allocated 624 bytes (0 KB) for 1 request's buffer.
> uwsgi: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr)
> (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
> malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size)
> >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk,
> fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t)))
> - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end &
> pagemask) == 0)' failed.
> Aborted
>
> (I'm using the Ubuntu PPA version)
>
> If I comment the second entry block ([foobar]), I get :
>
> # uwsgi --ini uwsgi.ini
> *** Starting uWSGI 0.9.6.1 (64bit) on [Fri Sep 17 17:24:34 2010] ***
> compiled with version: 4.4.3
> Python version: 2.6.5 (r265:79063, Apr 16 2010, 14:15:55)
> [GCC 4.4.3]
> uWSGI running as root, you can use --uid/--gid/--chroot options
>  *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
>  *** WARNING: you are running uWSGI without its master process manager ***
> your memory page size is 4096 bytes
> allocated 624 bytes (0 KB) for 1 request's buffer.
> The -s/--socket option is missing and stdin is not a socket.
>
> Strange, because if that mode of running is supposed to work, I have
> the sockets defined.
>
> Thanks for your help,
> Luc Stepniewski
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to