Scott,
What happens if you write the program in C on the 400 and don't use the CGI
API for standard output, but use the native C runtime? Same or better?

-Bob Cozzi
www.RPGxTools.com
RPG xTools - Enjoy programming again.


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of web400@xxxxxxxxxxxxxxxx
Sent: Monday, October 31, 2005 1:47 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] RE: Slow CGI Performance


> After the first CGI load everything is fine but if you wait 15 mins and 
> go back and try to access the page again it takes nearly 60 secs to load 
> the page.  But if I go to the page and keep access different things the 
> performance is really good.

I've been having the same problem since upgrading to V5R3. (I didn't have 
any problem with V5R2.  I used Apache on both versions.)

It's definitely not the time it takes to open files or parse input, 
because I have the problem with even the most trivial of programs. 
Consider the following program:

      H DFTACTGRP(*NO)

      D QtmhWrStout     PR                  extproc('QtmhWrStout')
      D   DtaVar                   32766A   options(*varsize) const
      D   DtaVarLen                   10I 0 const
      D   ErrorCode                32766A   options(*varsize)
      D errornull       s              8A   inz(*allx'00')
      D data            s            100A   varying
       /free
         data = 'content-type: text/html' + x'2525'
              + '<h1>test output</h1>' + x'25';
         QtmhWrStout(data: %len(data): errornull);
         return;
       /end-free

As you can see, it doesn't really do anything that should require 
expensive startup.  If I run this program interactively, even if it needs 
to start an activation group, it runs in a fraction of a second.

But, running the same thing through the HTTP server creates this 30 second 
lag.  If I call it again immediately afterwards, the response is instant. 
If I wait an hour or so and run it again (even if nobody else uses this 
HTTP instance, so I know the program's still loaded) it'll be really slow 
again.

I tried doubling the RAM in my machine, but it didn't help.

If however, I write a comparable program in C and run it on a FreeBSD PC 
with the exact same version of Apache, it runs fast.  Even on a 486SX-25 
with 8mb of RAM.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.