> I'm using the following command (manually wrapped to multiple lines) > to start uWSGI for running a Perl application via PSGI: > > uwsgi --reaper --vacuum --single-interpreter --master --processes 1 > --http-modifier1 5 --plugins psgi > --http 0.0.0.0:$VCAP_APP_PORT --psgi app.psgi > > Communication to nginx is via a router that only talks HTTP, so I can't > use the native uwsgi protocol. It works fine: > > *** Starting uWSGI 0.9.8.5 (64bit) on [Fri Oct 21 22:36:17 2011] *** > compiled with version: 4.5.2 on 20 October 2011 23:09:29 > your memory page size is 4096 bytes > spawned uWSGI http 1 (pid: 249) > HTTP router/proxy bound on 0.0.0.0:3000 > uwsgi socket 0 bound to TCP address 127.0.0.1:48632 (port auto-assigned) > fd 3 > initializing Perl 5.14.2 environment > your server socket listen backlog is limited to 100 connections > *** Operational MODE: single process *** > Prototype mismatch: sub main::get: none vs ($) at app.pl line 4 > PSGI app (app.psgi) loaded at 0x1ee4490 > *** no app loaded. going in full dynamic mode *** > spawned uWSGI master process (pid: 246) > spawned uWSGI worker 1 (pid: 250, cores: 1) > recv(): Success [plugins/http/http.c line 570] > > I got some feedback (indirectly) from Roberto saying: > > | 3) running the --http option will spawn an additional process doing > | proxy from http to uwsgi. This is a waste of resources. You can use > | --protocol=http --socket :port to let uWSGI natively speaks HTTP > | (if you cannot use the uwsgi protocol directly) > > So I changed the invocation to (only 3rd line changed): > > uwsgi --reaper --vacuum --single-interpreter --master --processes 1 > --http-modifier1 5 --plugins psgi > --protocol=http --socket=0.0.0.0:$VCAP_APP_PORT --psgi app.psgi > > This no longer works: > > *** Starting uWSGI 0.9.8.5 (64bit) on [Fri Oct 21 22:37:27 2011] *** > compiled with version: 4.5.2 on 20 October 2011 23:09:29 > your memory page size is 4096 bytes > uwsgi socket 0 bound to TCP address 0.0.0.0:3000 fd 3 > initializing Perl 5.14.2 environment > your server socket listen backlog is limited to 100 connections > *** Operational MODE: single process *** > Prototype mismatch: sub main::get: none vs ($) at app.pl line 4 > PSGI app (app.psgi) loaded at 0x2d1a4f0 > *** no app loaded. going in full dynamic mode *** > spawned uWSGI master process (pid: 246) > spawned uWSGI worker 1 (pid: 249, cores: 1) > recv(): Success [proto/http.c line 233] > error parsing request > > Is this a bug, or is this simply not supposed to work for PSGI?
Yes, but you have to use: --remap-modifier 0:5 this will map the psgi plugin as the default one > > It is also not clear to me if I should have used "--http-modifier1 5" > with the "--protocol=http" option, or not. It doesn't work either way > right now though. > > no --http-modifier1 is only for the http server/router not for the embedded one Take in account that current (mercurial tip or latest github, will be in 1.0-rc2 tomorrow) http parser supports url decoding for PATH_INFO, and this should fix issues with exotic chars in the urls. -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
