ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How can I prevent program cashing in apache

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I prevent program cashing in apache

    Hello

    My company uses CGIDEV2 for our web development. And I heartily recommend it, it works great.

    We sometimes experience our programs being cashed by the apache server. When we make changes to programs the server has cashed the previous version of the program and doesnt reflect the current changes.

    Does anyone know of any directives that we can use that will disable the program cashing.

    It' not a problem, but it's something that can be confusing in instances .

    Thank You

  • #2
    Re: How can I prevent program cashing in apache

    Apache doesn't cache ('cash'? haha) data from CGI programs.

    Is it possible that it's still using the old copy of the program? Normally the way it works on IBM i when you replace a program is the old copy of the program is put in the QRPLOBJ library. Anyone who still has the old program activated wil continue to use the old copy until it gets deactivated, at which time it'll start using the new one.

    So, if you have your program compiled with ACTGRP(SOMENAME) then it'll remain activated until you reclaim the activation group, or recompile the program that starts the activation group. If you use ACTGRP(*NEW), then it'll get a new activation each time the progam is called. (Which will affect performance, but you'll never have to worry about getting the old copy of the program.)

    Comment


    • #3
      Re: How can I prevent program cashing in apache

      I said "cash" because my spell checker was flagging it.

      I wasnt talking about data being cashed, I was referring to programs being cashed.

      If we compile with actgrp(*new) will that build up on memory usage. We have over 1000 users banging away on our 400 everyday using RPGLE cgi programs
      Last edited by davisty; January 15, 2014, 02:10 PM.

      Comment


      • #4
        Re: How can I prevent program cashing in apache

        In ILE, a program is loaded into an activation group the first time it's called. It (and everything it calls inside the same activation group) then stays in memory until the activation group ends -- this is done to improve performance.

        When you code ACTGRP(*NEW), this will cause the program (and everything it calls within the same activation group) to be unloaded from memory as the program ends. This means the computer has to do more work, because it takes time to close everything down and remove it from memory. When it's called the next time, everything has to be re-loaded into memory. So this requires more work for the computer, and therefore will impact performance.

        However, ACTGRP(*NEW) will use _less_ memory because it cleans everything up.

        Comment


        • #5
          Re: How can I prevent program cashing in apache

          Im sorry, one more question. If I were to compile with actgrp(*caller) for the CGI programs which actgrp would it call. Would it be the apache actgrt. if so, would the apache server control the cleanup of the cgi actgrp?

          Thank You for you time.

          Comment


          • #6
            Re: How can I prevent program cashing in apache

            For the program that's called by Apache, if you do ACTGRP(*CALLER), it will end up in the OPM ("default") activation group. This will mean that the program cannot be unloaded from memory without ending the job. It will also mean that RCLRSC will break any service programs (including CGISRVPGM2) that get loaded. I strongly recommend not using *CALLER for the initial program called by Apache. Instead, use a real activation group (either *NEW or a named one). Now, for any programs or service programs that your program calls, that's a different story... *CALLER is fine for those.

            Comment


            • #7
              Re: How can I prevent program cashing in apache

              Thank You for clearing that up for me. It is very much appreciated.

              Comment

              Working...
              X