• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCLASSES Folders

LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

2.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 22, 2006 Jun 22, 2006

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 23, 2006 Jun 23, 2006

Copy link to clipboard

Copied

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.
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 14, 2019 Sep 14, 2019

Copy link to clipboard

Copied

LATEST
Shell tip: anytime you use wildcard (the * char) the shell will expand it to all the file names. When this list becomes long, it can easily exceed the max length of the command line buffer. This should not cause the shell to crash, but instead emit an error message. You can easily use the 'find' utility instead., with the '-exec' option. Example for this situation: "find . -name '*.class' -exec rm {} \;"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 23, 2006 Jun 23, 2006

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2007 Feb 02, 2007

Copy link to clipboard

Copied

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!).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 02, 2007 Feb 02, 2007

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 02, 2007 Feb 02, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation