Entries Tagged as Performance

Railo 4.1: Smarter Template Compilation

March 08, 2013 · 3 Comments

Version 4.1 of Railo brings with it many updates and improvements. One of these improvements that this version brings is the new way in which Railo Server now manages Java class information.

Each time a CFML template is modified, Railo recompiles it and generates a new Java class file. This has, up until now, had two major implications:

  1. The JVM keeps the compiled class information in an area called the Permanent Generation (commonly referred to as PermGen). This area is a finite resource, so the more changes you make to your templates the more memory is consumed. The problem is that, as the name implies, this information is supposedly "Permanent" and therefore the memory is not reclaimed by the Garbage Collector the same way as the object memory on the Heap does.
  2. In order to dispose of the loaded classes, Railo had to dispose of the class loader that loaded that class, which resulted in the undesired disposal of all the other classes that were loaded by that class loader. That of course meant that all of the classes that were disposed of unnecessarily needed to be loaded again.

So what's new now?
Now Railo has the ability to modify the Java bytecode of a loaded class -- so instead of unloading a bunch of classes and then loading them back -- Railo simply updates the bytecode for the Java class in place, which results in a huge performance gain and improved PermGen memory management.

The only thing you have to do in order to take advantage of this new feature is to enable the Java Agent for the JVM. This can be done easily by using the command line switch -javaagent and specify the location of the railo-inst.jar in the format: -javaagent:{path-to-jar}/railo-inst.jar

In most cases when you login to the Railo Server Administrator, Railo will tell you the correct path to the jar file. For example, on a typical Railo Express setup that path is "lib/ext/" so to use it simply open the batch/shell file that you use to start Railo, and add -javaagent:lib/ext/railo-inst.jar to the command line arguments.

A typical command line would be: java -javaagent:lib/ext/railo-inst.jar -Xms256M -Xmx1024M -jar start.jar

Usually we conclude our messages with the statement "Have fun with Railo", but we think that this time it would be more accurate to say:
Be productive with Railo!

3 CommentsTags: Performance · Railo 4.1

User Agent Parser

November 19, 2012 · 4 Comments

Last week I needed to write a piece of software that analyzes the HTTP user agent and then determines what's behind the single log entries. So I was scanning the net for a piece of code that would help me with a solution.

[Read more →]

4 CommentsTags: cache · Performance · Railo 4.0

Using the new Railo 4.0 CLI

July 24, 2012 · 10 Comments

With Railo 4.0 we have introduced the command line interface (CLI) that allows you to call .cfm files from your
current webroot. No webserver and no application server is involved when calling .cfm templates through the CLI.
For the moment this functionality is a little restricted but it will change until the final release of the CLI in Railo 4.0.

[Read more →]

10 CommentsTags: CLI · Features · Performance · Railo 4.0 · Tips

Prevent threading problems with local scope

May 21, 2012 · 2 Comments

By default, variables defined inside a function or method are stored in the variables scope (of the template or the component). This can lead to threading problems if - for instance - a component is stored as a singleton in the application scope. Railo allows you to prevent this problem by controlling the local scope.

[Read more →]

2 CommentsTags: Configuration · HowTo · Performance

Improve performance by turning off Scope Cascading

May 14, 2012 · 9 Comments

Scope cascading, also known as scope precedence makes it easier for inexperienced developers to code, but slows down server performance. In Railo, scope cascading can be turned off.

[Read more →]

9 CommentsTags: Configuration · Performance · Tips

Railo Tip of the Week: Query Cache

January 23, 2012 · 2 Comments

If you are using the query cache and you would like to flush the cache you can use the tag <cfobjectcache action = "clear"> in order to do so.

[Read more →]

2 CommentsTags: HowTo · Performance · Tips

Railo Tip of the Week: Page Pool

January 16, 2012 · 7 Comments

Greetings and welcome to the first in our weekly series of Railo tips! Over the years, we've picked up a trick or two using Railo and we wanted to share these with you. And so, without further adieu, we are happy to present our first tip!

[Read more →]

7 CommentsTags: Performance · Tips

Improve the speed for CFSilent

November 16, 2010 · No Comments

This is a quick tip that can help you improve the performance of CFSILENT.

[Read more →]

No CommentsTags: Performance · Railo 3.1.2 · Tips

Upgrading the JRE used in Railo

August 04, 2009 · No Comments

When you install Railo, the default JRE that comes with it is 1.6.0_01. So you might want to upgrade it some when.

[Read more →]

No CommentsTags: Configuration · HowTo · Performance · Railo 3.1

Struct addressing in Railo

November 17, 2008 · 8 Comments

There is a major difference in how Railo addresses structs in comparison to the CFML standard. The result is that implicit addressing, (as I call it) works in the CFML standard but not in Railo. This is an issue we are long aware of AND we will NOT fix it.

[Read more →]

8 CommentsTags: CFML · Comparison · HowTo · Performance · Railo 3.0 · Standards · Testing