9 Replies Latest reply on Feb 2, 2007 5:51 AM by Dan Bracuk

    CFCLASSES Folders

    Level 7
      How does anyone here deal with the cfclasses folder?

      Our application dynamically generates ColdFusion files and sometimes
      also deletes them, but ColdFusion never removes any old files from the
      cfclasses folder. Has anyone come up with any clever solutions on how
      to resolve this. I've thought about using a scheduled task to remove
      any class files which may be older than a certain date, knowing full
      well that they could still be legitimate files.

      But unfortunately cfdirectory does not allow you to filter on dates or
      limit the number of rows.

      Any ideas are welcome.

      Thanks
        • 1. Re: CFCLASSES Folders
          Level 7
          There is an Administrator setting that limits how many class files to
          keep on hand. I would check that out first.

          Don Vaillancourt wrote:
          > How does anyone here deal with the cfclasses folder?
          >
          > Our application dynamically generates ColdFusion files and sometimes
          > also deletes them, but ColdFusion never removes any old files from the
          > cfclasses folder. Has anyone come up with any clever solutions on how
          > to resolve this. I've thought about using a scheduled task to remove
          > any class files which may be older than a certain date, knowing full
          > well that they could still be legitimate files.
          >
          > But unfortunately cfdirectory does not allow you to filter on dates or
          > limit the number of rows.
          >
          > Any ideas are welcome.
          >
          > Thanks
          • 2. Re: CFCLASSES Folders
            Level 7
            You sure. I just checked it now and I can't see it. What's it called.

            Or are you talking about trusted templates, which is something entirely
            different.


            Ian Skinner wrote:
            > There is an Administrator setting that limits how many class files to
            > keep on hand. I would check that out first.
            >
            > Don Vaillancourt wrote:
            >> How does anyone here deal with the cfclasses folder?
            >>
            >> Our application dynamically generates ColdFusion files and sometimes
            >> also deletes them, but ColdFusion never removes any old files from the
            >> cfclasses folder. Has anyone come up with any clever solutions on how
            >> to resolve this. I've thought about using a scheduled task to remove
            >> any class files which may be older than a certain date, knowing full
            >> well that they could still be legitimate files.
            >>
            >> But unfortunately cfdirectory does not allow you to filter on dates or
            >> limit the number of rows.
            >>
            >> Any ideas are welcome.
            >>
            >> Thanks
            • 3. Re: CFCLASSES Folders
              Level 7
              I was talking about this:

              Server Settings > Caching

              Maximum number of cached templates

              Limits the number of templates cached using template caching. If the
              cache is set to a small value, ColdFusion might re-process your
              templates. If your server has a sufficient amount of memory, you can
              achieve optimum performance by setting this value to the total number of
              all of your ColdFusion templates. Setting the cache to a high value does
              not automatically reduce available memory because ColdFusion caches
              templates incrementally.

              But I guess that is the amount of templates in memory not on the hard
              drive. Sorry.

              Don Vaillancourt wrote:
              > You sure. I just checked it now and I can't see it. What's it called.
              >
              > Or are you talking about trusted templates, which is something entirely
              > different.
              >
              >
              > Ian Skinner wrote:
              >> There is an Administrator setting that limits how many class files to
              >> keep on hand. I would check that out first.
              >>
              >> Don Vaillancourt wrote:
              >>> How does anyone here deal with the cfclasses folder?
              >>>
              >>> Our application dynamically generates ColdFusion files and sometimes
              >>> also deletes them, but ColdFusion never removes any old files from
              >>> the cfclasses folder. Has anyone come up with any clever solutions
              >>> on how to resolve this. I've thought about using a scheduled task to
              >>> remove any class files which may be older than a certain date,
              >>> knowing full well that they could still be legitimate files.
              >>>
              >>> But unfortunately cfdirectory does not allow you to filter on dates
              >>> or limit the number of rows.
              >>>
              >>> Any ideas are welcome.
              >>>
              >>> Thanks
              • 4. Re: CFCLASSES Folders
                Level 7
                There's an option in CF Administrator not not even create these files in
                the first place. "Save class files". I think it's on the "cache" page, or
                something.

                The only time they're used is when the server is restarted, to save the
                server recompiling the source code files: quite a large - one off -
                performance hit.

                On the other hand, if they exist, the server needs to check the timestamp
                on the files *every time* they're called, which has a slight performance
                impact.

                --
                Adam
                • 5. Re: CFCLASSES Folders
                  Level 7
                  Hmm!

                  I know about this option. But clients will freak out a lot if the
                  application takes a long time to recompile the classes after a restart.

                  I just ran a test on my test computer not nice. Really not nice if you
                  run a dozen sites on one install.

                  What sucks about all this is that I can't do a "rm -f *" under Linux
                  cause it causes the shell to crash. So I need to do a "rm -f `ls -1 |
                  head -n2000`" which is a real pain in the butt.

                  Thanks


                  Adam Cameron wrote:
                  > There's an option in CF Administrator not not even create these files in
                  > the first place. "Save class files". I think it's on the "cache" page, or
                  > something.
                  >
                  > The only time they're used is when the server is restarted, to save the
                  > server recompiling the source code files: quite a large - one off -
                  > performance hit.
                  >
                  > On the other hand, if they exist, the server needs to check the timestamp
                  > on the files *every time* they're called, which has a slight performance
                  > impact.
                  >
                  • 6. Re: CFCLASSES Folders
                    Level 7
                    > I know about this option. But clients will freak out a lot if the
                    > application takes a long time to recompile the classes after a restart.

                    Well: restarting shouldn't be something that happens very often. Esp as
                    you seem to be running on Linux.

                    CF ships with a cfcompile.bat (or something, I've never used it), which - I
                    presume - hits all files in an app and accordingly compiles them. Even if
                    *it* doesn't do that, it'd be easy enough to write something that does.

                    > What sucks about all this is that I can't do a "rm -f *" under Linux
                    > cause it causes the shell to crash.

                    Uh? How come?

                    > So I need to do a "rm -f `ls -1 |
                    > head -n2000`" which is a real pain in the butt.

                    In Windows I just press ctrl-a and shift-delete: all gone. I seriously
                    can't believe Windows could possibly achieve any sort of file system
                    activity better than Linux can. Exactly how many files are you talking
                    about here?

                    --
                    Adam
                    • 7. Re: CFCLASSES Folders
                      eddieralph Level 1
                      We run a windows scheduled task to delete class files in that folder that are older than a couple of days. I'm currently looking for a better solution... typically we have > 15,000 files in there at any one time (that's with clearing out files that are older than 2 days!).
                      • 8. Re: CFCLASSES Folders
                        Level 7
                        > We run a windows scheduled task to delete class files in that folder that are
                        > older than a couple of days. I'm currently looking for a better solution...
                        > typically we have > 15,000 files in there at any one time (that's with clearing
                        > out files that are older than 2 days!).

                        You can switch them off completely in CFAdmin. They serve very little
                        purpose, and apparently slow things down on large applications, a CF has to
                        to a directory scan each time a template is called to see if the class file
                        is up to date. I don't imagine the directory scan is such a problem on
                        *nix systems, but it's slow on Windows once one has more than a few hundred
                        files in a directory (in my experience).

                        The only performance hit you will receive if you don't bother saving them
                        is that the application will be slightly slow after a CF restart, as it
                        recompiles all the source code (which thenceforth is held in memory). The
                        only thing the class files are for is to reduce the first compile time:
                        they're a hindrance after that.

                        As you should not be doing CF restarts on a production server, there's no
                        benefit in saving them. And I find CF gets confused sometimes between
                        which is more up to date - source code or class file - anyhow, so it can
                        cause issues in a dev environment too.

                        --
                        Adam
                        • 9. Re: CFCLASSES Folders
                          Dan Bracuk Level 5
                          quote:

                          Originally posted by: Newsgroup User
                          But unfortunately cfdirectory does not allow you to filter on dates or
                          limit the number of rows.


                          It does for other folders. Is there something special about this one?