To make the most of the RPG+DB2+OS400 combination it is an important goal of RPGUI to have stateful jobs so the programmer doesn't have to worry about things like open data paths, global variables needing to be re-initialized, etc. To meet this need we need to have a one-user-per-job approach so the web runtime environment is very similar to traditional 5250 programming.
The need for a sort of "CGI Router" is necessary so requests can be received in from the browser and routed to the appropriate user job via data queue. To see where this component fits into the mix you can go to this page: https://sourceforge.net/apps/mediawiki/rpgui/index.php?title=Main_Page#Flow_Of_Processing
Obviously the one-user-per-job approach stands the chance of not scaling for high traffic web sites. There will be a performance matrix created that shows what is required for hardware for x number of users. With that said, it will also be necessary for RPGUI to support the "stateless" model, which it already does out of the box, just not with well developed patterns (but that will be coming in the near future).
This item has some initial work complete by Rory Hewitt. Please see the RPGUIRTR, RPGUICTL and RPGUITST source members in QRPGLESRC for reference.