0
coldfusion class loading and code file access
LEGEND
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/td-p/241083
Sep 12, 2007
Sep 12, 2007
Copy link to clipboard
Copied
All,
I'm looking for documentation, official or otherwise, on how coldfusion
processes code files and retains them in memory. I seem to remember waaaay
back that there was documentation on the fact that CF would read a .cfm file
and keep it as p-code in memory, and on every request for that template it
would check to see if that file changed.
What i'm wondering is: is that still the case, except that instead of p-code
it's classes? And, if you have 1000 code files on an attached device (a SAN,
for example), does every request for one of those files require CF to reach
out to that file across the network?
I'd really like to see something official from adobe on this one. Our
network team is concerned that if we move our code off of web servers and
onto network devices that it will cripple the network, and these people seem
to have an uncanny ability to ignore data and tests and proof. but if tom
jordahl or ben forta or tim buntel or sean corfield or some other known CF
folk published something on this, well, that might just get them to listen.
I know that sounds moronic, but it's the world i live in.
Thanks for any pointers.
Marc
I'm looking for documentation, official or otherwise, on how coldfusion
processes code files and retains them in memory. I seem to remember waaaay
back that there was documentation on the fact that CF would read a .cfm file
and keep it as p-code in memory, and on every request for that template it
would check to see if that file changed.
What i'm wondering is: is that still the case, except that instead of p-code
it's classes? And, if you have 1000 code files on an attached device (a SAN,
for example), does every request for one of those files require CF to reach
out to that file across the network?
I'd really like to see something official from adobe on this one. Our
network team is concerned that if we move our code off of web servers and
onto network devices that it will cripple the network, and these people seem
to have an uncanny ability to ignore data and tests and proof. but if tom
jordahl or ben forta or tim buntel or sean corfield or some other known CF
folk published something on this, well, that might just get them to listen.
I know that sounds moronic, but it's the world i live in.
Thanks for any pointers.
Marc
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241084#M21471
Sep 12, 2007
Sep 12, 2007
Copy link to clipboard
Copied
By default, ColdFusion will do exactly what you describe.
However, if you have "Trusted Cache" enabled, which...in a production context, you always should!, ColdFusion will not reach out across the network and check for file-changes. It "trusts" the version of the p-code that it has in memory, and never looks for changes again. This applies to both .cfm, and .cfc files.
You can read more about this setting here:
http://www.adobe.com/devnet/server_archive/articles/server_caching_cf.html#trustedcache
So, if you have Trusted Cache enabled, you should have no worries on crippling the network.
I hope this helps.
However, if you have "Trusted Cache" enabled, which...in a production context, you always should!, ColdFusion will not reach out across the network and check for file-changes. It "trusts" the version of the p-code that it has in memory, and never looks for changes again. This applies to both .cfm, and .cfc files.
You can read more about this setting here:
http://www.adobe.com/devnet/server_archive/articles/server_caching_cf.html#trustedcache
So, if you have Trusted Cache enabled, you should have no worries on crippling the network.
I hope this helps.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Adobe Employee
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241085#M21472
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Grizzly9279 is absolutely right.
1. ColdFusion first checks if the cfm's class is loaded or not
2. If it is not loaded, then compile it and load it
3. If it is already loaded, then checks if the trusted cache is on. If that is on, then use that class.
4. If trusted class is off, then use the timestamp to check if the file needs recompilation.
5. If recompilation is needed, the recompile otherwise use the class.
If the trusted cache is on, then the server will never ever touch your disk to check for recompilation.
1. ColdFusion first checks if the cfm's class is loaded or not
2. If it is not loaded, then compile it and load it
3. If it is already loaded, then checks if the trusted cache is on. If that is on, then use that class.
4. If trusted class is off, then use the timestamp to check if the file needs recompilation.
5. If recompilation is needed, the recompile otherwise use the class.
If the trusted cache is on, then the server will never ever touch your disk to check for recompilation.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241086#M21473
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Thanks guys. So the 2nd question: is it considered good
practice, or at
least not bad practice, to keep one's code on the san, particularly in the
situation where you have a large farm of webservers and you need to mitigate
code synchronization issues.
"rupesh_kumar" <webforumsuser@macromedia.com> wrote in message
news:fcbuno$an3$1@forums.macromedia.com...
> Grizzly9279 is absolutely right.
> 1. ColdFusion first checks if the cfm's class is loaded or not
> 2. If it is not loaded, then compile it and load it
> 3. If it is already loaded, then checks if the trusted cache is on. If
> that is
> on, then use that class.
> 4. If trusted class is off, then use the timestamp to check if the file
> needs
> recompilation.
> 5. If recompilation is needed, the recompile otherwise use the class.
>
> If the trusted cache is on, then the server will never ever touch your
> disk to
> check for recompilation.
>
least not bad practice, to keep one's code on the san, particularly in the
situation where you have a large farm of webservers and you need to mitigate
code synchronization issues.
"rupesh_kumar" <webforumsuser@macromedia.com> wrote in message
news:fcbuno$an3$1@forums.macromedia.com...
> Grizzly9279 is absolutely right.
> 1. ColdFusion first checks if the cfm's class is loaded or not
> 2. If it is not loaded, then compile it and load it
> 3. If it is already loaded, then checks if the trusted cache is on. If
> that is
> on, then use that class.
> 4. If trusted class is off, then use the timestamp to check if the file
> needs
> recompilation.
> 5. If recompilation is needed, the recompile otherwise use the class.
>
> If the trusted cache is on, then the server will never ever touch your
> disk to
> check for recompilation.
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241087#M21474
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
RE: Marc E
It would certainly make deployments of code changes easier to manage. Our production site only has two app servers currently, so we actually host all of the code on local disks, and deploy changes to each server individually. It's not all that bad for now, but if we ever expanded to 5, 10, or 20 app servers, it would be difficult.
I've heard of plenty of other folks hosting code/class files on a SAN. For medium to large server farms I think it's got to be the best way to go. I really can't speak from personal experience though.
It would certainly make deployments of code changes easier to manage. Our production site only has two app servers currently, so we actually host all of the code on local disks, and deploy changes to each server individually. It's not all that bad for now, but if we ever expanded to 5, 10, or 20 app servers, it would be difficult.
I've heard of plenty of other folks hosting code/class files on a SAN. For medium to large server farms I think it's got to be the best way to go. I really can't speak from personal experience though.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241088#M21475
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Thanks Grizzly.
Here's a correlary question: Let's say trusted cache is not used....(we
don't use it on cfmx6 b/c there was no good/automatable way of clearing
class files, and we deploy fairly frequently. We'll use it on cf8. )
Is it conceivable that the activity just in the file "checking" could cause
noticeable load on a network? and i'm not talking about web servers in New
Jersey and a san in Malaysia. I'm talking about webservers in one rack and a
san right beside it in the same room.
thanks guys.
"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fcc8l9$l5l$1@forums.macromedia.com...
> RE: Marc E
>
> It would certainly make deployments of code changes easier to manage. Our
> production site only has two app servers currently, so we actually host
> all of
> the code on local disks, and deploy changes to each server individually.
> It's
> not all that bad for now, but if we ever expanded to 5, 10, or 20 app
> servers,
> it would be difficult.
>
> I've heard of plenty of other folks hosting code/class files on a SAN.
> For
> medium to large server farms I think it's got to be the best way to go. I
> really can't speak from personal experience though.
>
>
Here's a correlary question: Let's say trusted cache is not used....(we
don't use it on cfmx6 b/c there was no good/automatable way of clearing
class files, and we deploy fairly frequently. We'll use it on cf8. )
Is it conceivable that the activity just in the file "checking" could cause
noticeable load on a network? and i'm not talking about web servers in New
Jersey and a san in Malaysia. I'm talking about webservers in one rack and a
san right beside it in the same room.
thanks guys.
"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fcc8l9$l5l$1@forums.macromedia.com...
> RE: Marc E
>
> It would certainly make deployments of code changes easier to manage. Our
> production site only has two app servers currently, so we actually host
> all of
> the code on local disks, and deploy changes to each server individually.
> It's
> not all that bad for now, but if we ever expanded to 5, 10, or 20 app
> servers,
> it would be difficult.
>
> I've heard of plenty of other folks hosting code/class files on a SAN.
> For
> medium to large server farms I think it's got to be the best way to go. I
> really can't speak from personal experience though.
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241089#M21476
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
I really don't think it would be a problem with or without
trusted cache.
Our front-end web servers (hosting PDFs, images, css, and js files) store all of their data on a network drive on our SAN, and it's never been an issue at all. (and we get quite a bit of traffic) We don't use any caching whatsoever for these files.
Is there any way you can set up a test environment, and throw some load tests at it (with jmeter for example) to measure the impact on the network?
Our front-end web servers (hosting PDFs, images, css, and js files) store all of their data on a network drive on our SAN, and it's never been an issue at all. (and we get quite a bit of traffic) We don't use any caching whatsoever for these files.
Is there any way you can set up a test environment, and throw some load tests at it (with jmeter for example) to measure the impact on the network?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Newsgroup_User
AUTHOR
LEGEND
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241090#M21477
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Oh, indeed. I've jmetered the hell out of this thing. It
appears that my
problem is a people problem, really. the people i need to convince aren't
convinced by what would appear to be "facts". It seems I need a "really
important person" to say "this is the truth....". Woe.
One thing I can't duplicate in a test environment, though, is the nature of
our production network. it handles massive amounts of data, and I think
that's where their concern is. "tests are fine in your rinky dink test
network, but on our badass prod network serving a gazillion bits a
nanosecond, we don't want your webservers talking over 3 ft. of network
cable to the san sitting beside it". it's that kind of situation.
"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fccakb$nbh$1@forums.macromedia.com...
>I really don't think it would be a problem with or without trusted cache.
>
> Our front-end web servers (hosting PDFs, images, css, and js files) store
> all
> of their data on a network drive on our SAN, and it's never been an issue
> at
> all. (and we get quite a bit of traffic) We don't use any caching
> whatsoever
> for these files.
>
> Is there any way you can set up a test environment, and throw some load
> tests
> at it (with jmeter for example) to measure the impact on the network?
>
>
problem is a people problem, really. the people i need to convince aren't
convinced by what would appear to be "facts". It seems I need a "really
important person" to say "this is the truth....". Woe.
One thing I can't duplicate in a test environment, though, is the nature of
our production network. it handles massive amounts of data, and I think
that's where their concern is. "tests are fine in your rinky dink test
network, but on our badass prod network serving a gazillion bits a
nanosecond, we don't want your webservers talking over 3 ft. of network
cable to the san sitting beside it". it's that kind of situation.
"Grizzly9279" <webforumsuser@macromedia.com> wrote in message
news:fccakb$nbh$1@forums.macromedia.com...
>I really don't think it would be a problem with or without trusted cache.
>
> Our front-end web servers (hosting PDFs, images, css, and js files) store
> all
> of their data on a network drive on our SAN, and it's never been an issue
> at
> all. (and we get quite a bit of traffic) We don't use any caching
> whatsoever
> for these files.
>
> Is there any way you can set up a test environment, and throw some load
> tests
> at it (with jmeter for example) to measure the impact on the network?
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241091#M21478
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Argh, I understand completely. Best of luck with it I guess.
I wish I could point you to some more "official" documentation
suggesting it as a best practice, but my searches have come up dry.
I'll poke around a bit more tonight and see what I can come up with. It's a topic I'm fairly interested in for our own production environment anyways. If I find anything more "official" I'll definitely come back and give you a shout.
I'll poke around a bit more tonight and see what I can come up with. It's a topic I'm fairly interested in for our own production environment anyways. If I find anything more "official" I'll definitely come back and give you a shout.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Adobe Employee
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241092#M21479
Sep 13, 2007
Sep 13, 2007
Copy link to clipboard
Copied
Hi Marc,
I would say that you must have trusted cache enabled In the production environment. Having it disabled means touching the disk for every web request and that is costly. And it would hurt even more (I cant say the extent though.. ) when the file is over network.
As far as we have seen in our load tests, you easily get ~20% performance boost (in some cases even more) just by enabling it.
As far as removing items from the template cache is concerned, CFMX 7 provided an API as well as UI in admin to clear the template cache. in ColdFusion 8, we have also added the ability to remove a particular template from the cache. So, that should take care of automating the process of clearing the cache when you deploy.
I would say that you must have trusted cache enabled In the production environment. Having it disabled means touching the disk for every web request and that is costly. And it would hurt even more (I cant say the extent though.. ) when the file is over network.
As far as we have seen in our load tests, you easily get ~20% performance boost (in some cases even more) just by enabling it.
As far as removing items from the template cache is concerned, CFMX 7 provided an API as well as UI in admin to clear the template cache. in ColdFusion 8, we have also added the ability to remove a particular template from the cache. So, that should take care of automating the process of clearing the cache when you deploy.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241093#M21480
Sep 14, 2007
Sep 14, 2007
Copy link to clipboard
Copied
is there a way to clear the cache, even manually, in mx
6.1?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
LATEST
/t5/coldfusion-discussions/coldfusion-class-loading-and-code-file-access/m-p/241094#M21481
Sep 14, 2007
Sep 14, 2007
Copy link to clipboard
Copied
RE: jonnycattt
I'm afriad not friend. Your MX 6.1 servers are going to require a service restart to clear the template cache.
The inconveniences of this are best mitigated by a standardized production deployment procedure. If your site(s) can establish an agreed upon weekly maintenance window (say, 6am-8am Sunday morning), than you can schedule and push code changes to production only once per week, and have those changes take effect every Sunday morning.
I'm afriad not friend. Your MX 6.1 servers are going to require a service restart to clear the template cache.
The inconveniences of this are best mitigated by a standardized production deployment procedure. If your site(s) can establish an agreed upon weekly maintenance window (say, 6am-8am Sunday morning), than you can schedule and push code changes to production only once per week, and have those changes take effect every Sunday morning.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

