Though service program cgicbldev2/cgicbldev2
provides CGI with a superior performance when compared to other WEB solutions,
the appropriate use of some techniques may achieve further results.
Named activation groups
We recommend to use named activationg groups. A named activation group is created by assigning
a user-defined name to parameter ACTGRP when creating a program via command CRTPGM or CRTBNDCBL.
Each program must be assigned a unique activation group.
An activation group is a set of resources a program is assigned at its activation time
(see ILE Advanced Concepts in iSeries Information Center).
By doing this, each time an instance CGI serving job is requested to process a program that has already been run,
the named activation group might be found to be already existing, thus saving the time to build it.
Exiting from the program without deleting the named activation group
Exiting from an ILE-COBOL program with end verbs like "STOP RUN", "EXIT PROGRAM", or "GOBACK",
would delete the activation group.
In order to improve performance, maximum care should be payed in exiting from the program without deleting
the activation group. This is achieved by using the COBOL end verb "EXIT PROGRAM AND CONTINUE RUN UNIT".
When this is done, a CGI, the next time is requested through the same HTTP server job, will
- find the program variables as they were left from the previous transaction
(therefore the CGI must not trust them)
- find the non-closed database paths pointers as they were left at program exit
(the CGI should then reposition the pointers through the appropriate database operations)
- find the service program storage as it was left.
This is very important, because in this case, when the CGI asks the service program to load the
external HTML, the service program will find that the external HTML is already in memory
and skip the loading, thus improving the transaction response time from five to ten times.
Should the CGI close the database files before exiting?
That is a developer option. Here are the consequences:
- Leaving the database files opened.
This can be done in the CGI by using a variable that tells whether the database file
were already opened in the previous transaction. All of our examples, but one, use this technique.
In this case, the CGI, after finding that the database files have been left opened, should reposition
the access pointers.
The good of this is that the open time is saved.
The bad of this is that the database files remain allocated until the
HTTP instance is ended. That may become a problem, when the need arises to save or reorganize those
database files.
HTTP server powered by Apache
HTTP server (powered by Apache) provides a number of ways to improve response time.
May we recommend a careful reading of
Chapter 10 -Getting the best performance from HTTP Server (powered by Apache) of redbook
HTTP Server (powered by Apache): An Integrated Solution for IBM e-server iSeries Servers.
For instance, we have found that great results may be obtained by compressing the HTML buffer before sending
it to the client browser, see
1.1.24: Compression.
Our experience with performance of HTTP server (powered by Apache) is reflected in our
HTTP directives to run the Easy400 website.
|