ColdFusion Muse

You CAN Use the File System With Cfdocument (Who Knew)

In regard to my previous post on Cfdocument and SSL I stand corrected. It is definitely possible to use a "file:" protocol identifier in the image path when using Cfdocument. My problem was with the syntax. As is often the case, a helpful reader put me on the right path. Thanks to Julian Halliwell for pointing out that my problem was syntax. I was trying 2 slashes as in:

<img src="file://d:\mysite\images\myimage.jpg" width="50" height="60">
Julian noted that it should actually be 3 leading slashes after the "file:" protocol identifier.
<img src="file:///d:\mysite\images\myimage.jpg" width="50" height="60">

Not only is this a rock solid fix for the SSL issue (see the previous post) but it has the potential to dramatically impact the speed of your cfdocument call, especially if you using large images. We have an application that embeds fairly large photographic images. I'm guessing this will greatly increase the speed of rendering. I'll post a follow up and let you know.

  • Share:

Cfdocument and SSL

Mark Kruger May 29, 2006 11:06 AM Coldfusion Optimization Comments (8)

Some of you might have read my post on Cfdocument Performance. One of the tips in that article is to watch out for external resources. If your HTML is pointing to images or css files (as opposed to "in-line" CSS), cfdocument will have to "go get" those files. The way it does this is important. The server does not does not simply "include" the file (a la cfinclude). Instead, cfdocument impersonates a browser and uses HTTP. This has an impact on how you use Cfdocument. Each cfdocument call has the potential to generate many http requests. Here are the details.

Read More
  • Share:

Limiting the Size of a POST Request

Mark Kruger May 24, 2006 2:05 PM Coldfusion Optimization Comments (9)

CF Muse Reader Asks:
With CF 7 is there a way to control the max file size on a upload? to prevent someone uploading a massive file?

Oh how I love easy questions. Yes Virginia you can do this but only "globally" through the CF Admin. Log into the CF Administrator and click on the "settings" link. There are 3 new settings that apply here. Here's the scoop from the release notes.

  • Maximum size of post data (MB) - Limits the amount of data that can be posted to the server in a single request. Coldfusion rejects single requests larger than the specified limit. The default value is 100 MB.

  • Request throttle threshold (MB) - Requests smaller than the specified limit are neither queued nor counted as part of the total memory. Requests larger than the specified limit are counted as part of total memory and are queued if the request throttle memory size has been exceeded. The default value is 4 MB.

  • Request throttle memory (MB) - Limits total memory size for the throttle. If there is not enough total memory available, Coldfusion queues requests until enough memory is free. The default value is 200 MB.
The "maximum size of post data" is the one that you need to worry about. It limits the amount of data that can be posted to Coldfusion. Keep in mind that if you expect a lot of this sort of activity the throttle memory will come into play. It's the total heap amount allocated to handle the throttle.

  • Share:

A Case for a Higher Default "Simultaneous Request" Setting

Mark Kruger May 4, 2006 6:45 PM Coldfusion Optimization, Coldfusion MX 7 Comments (3)

In a technote titled Coldfusion Performance Tuning that was last updated on March 7th 2003, the following advice was given regarding the "simultaneous request" setting in the Coldfusion administrator. The writer indicates that this setting has the largest impact on scalability, and then goes on to recommend a setting of 3 times the number of processors as a "starting point". This number has been oft stated as the "rule of thumb". I've heard as 2 to 3 requests per processor and I've often heard the number of 4 to 5 per processor, although I was unable to locate that recommendation in any online documents. I think this baseline recommendation should be changed to as high as 7 to 10 per processor for a CFMX server on a modern server (P4 or Xeon).

Read More
  • Share:

File Uploads - Does Size Really Matter?

When creating complicated web applications you sometimes run into situations where long running requests are necessary. Please don't email me with altruistic best practice jargon. I know they are not a good idea. My point is, that they can be unavoidable in some cases. Consider file upload for example. Suppose you need to allow users to upload more than 1 file in a single request (let's say 5) and suppose the files are typically .5 to 2 Megabytes. Potentially this means a maximum total aggregate of 6 megabytes.

Read More
  • Share:

Why is my Jrun Error Log So Big?

CF Muse Reader Asks:
On our CF 6.1 server, we have a /CFusionMX/runtime/logs/default-err.log file that is over 100MB in size. Is there a good way to knock that down, or is it okay to just delete the thing?

First things first, yes it is fine to delete this file. Make sure you know why it is growing so large - there may be errors you should be concerned about, and this file merits your review. In order to delte the file you will have to stop coldfusion. Upon a restarting Coldfusion will actually recreate the file starting with a nice tidy 1 kilobyte. You might notice that the "event" log actually "rolls over" every 200k. Wouldn't it be nice if the err log did that too? It can...

Read More
  • Share:

Sessions and Cookies and Bots (oh my)

Would you like to know how to create your own memory leak using the design of the Coldfusion Server to do it? Here's one way. Let's say you have a site that sells products from Narnia. It has a root folder that display your products and prices. You've done a great job of creating friendly links for browsing your Narnia products. You have stuffed Aslan lions both friendly and fearsome, White witch figurines, fauns, nyads, dryads, a toy lamppost and even a wardrobe for sale. Let's say (for the sake of argument) that you have 50 links to Narnia products just on your home page. If a user chooses to buy one of your products he or she clicks on "add to cart". At this point the user is taken into the "/shop/" folder to the page at "www.Nnarniaproducts.com/shop/cart.cfm". So far so good. This is how many online stores are organized and it's just peachy. But let's look under the hood shall we.

Listen Here

Read More

Terminal Services, Win3k SP1 and CF May Cause Memory Leak

Mark Kruger November 7, 2005 10:43 AM Coldfusion Optimization Comments (7)

Paul Vernon posted an interesting item on CF Talk regarding a memory leak on a Windows 2003 server running SP 1. His contention was that when you log on to a Win3k server that is running Coldfusion using terminal services, then log off again, the memory is not being released from the "winlogon" process. Over time the memory usage builds up into the hundreds of megabytes causing a resource utilization issue. We've seen this as well, although I do not think it has anything to do with Coldfusion. I imagine that other 3rd party server applications would cause the same behavior. In any case, I reviewed his fix and it seems to work splendidly. Here's some more information.

Read More
  • Share: