From 8cd0f80bd4ebf86a51206bb78e6e3012d8174bed Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 23 Apr 2010 19:22:37 -0500 Subject: [PATCH] some documentation additions/fixes --- README | 13 ++++++++----- app.psgi | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README b/README index cec8431da..4ab9f2f19 100644 --- a/README +++ b/README @@ -9,22 +9,25 @@ To try this out: Currently, the best performance is achieved via: plackup -E none -s Starman --workers 10 --disable-keepalive - + You can benchmark your server via: ab -t 3 -c 10 -k http://dev.localhost.localdomain:5000/ | grep Req - + I'm currently getting 370 requests/second, whereas I'm getting 430/second on the non-PSGI WebGUI8 branch. = ARCHITECTURE = -* The .psgi file gets to set WEBGUI_ROOT and WEBGUI_CONFIG. +* The root level app.psgi file loads all the config files found and + loads the site specific psgi file for each, linking them to the + proper host names. +* The site psgi file uses the WEBGUI_CONFIG environment variable to find the config. * It instantiates the $wg WebGUI object (one per app). * $wg creates and stores the WebGUI::Config (one per app) * $wg creates the $app PSGI app code ref (one per app) * WebGUI::Middleware::Session is wrapped around $app at the outer-most layer so that it can open and close the $session WebGUI::Session. Any other wG middleware that needs $session should go in between it and $app ($session created one per request) -* $session creates the $request WebGUI::Session::Request and $response WebGUI::Session::Response +* $session creates the $request WebGUI::Session::Request and $response WebGUI::Session::Response objects (one per request) - + diff --git a/app.psgi b/app.psgi index f57478db6..d03d8570c 100644 --- a/app.psgi +++ b/app.psgi @@ -9,7 +9,8 @@ builder { my $config = WebGUI::Config->new($config_file); my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI; my $app = do { - $ENV{WEBGUI_CONFIG} = $config_file; + # default psgi file uses environment variable to find config file + local $ENV{WEBGUI_CONFIG} = $config_file; Plack::Util::load_psgi($psgi); }; $first_app ||= $app; @@ -17,6 +18,8 @@ builder { mount "http://$sitename/" => $app; } } + + # use the first config found as a fallback mount '/' => $first_app; };