Lucee Low Speed


#1

Hi there!
I have a web application that is written in Cold Fusion. Recently I decided to install the latest version of Lucee and try running my application on it. I know Lucee is faster than CF but there is a big problem. Lucee’s page loading speed is too slow. In comparison to Cold Fusion 9, Lucee’s speed is one third of CF.
For local environment, I’m using MySQL 5.7.22 on Windows 10. I tried changing MySQL settings in my.ini file but got no results.
I would appreciate if someone help me about what should I do to improve the speed of Lucee.


#2

have you tried enabling debugging to see which section(s) of code are running slower?


#3

yes, all sections are running slowly in comparison to CF. For example a simple query in Lucee takes 40ms to run but in ColdFusion it takes only 6ms.


#4

Well that is odd. Is it on the same server and connecting to the same database?


#5

yes


#6

As you now installed Lucee, there might be settings that still needs to be set to further improve speed.
To begin with I would check how Coldfusion was setup and then use those settings also on Lucee.


#7

Is it only connecting to MySQL. skip-name-resolve may fix or try the ip address.


#9

which settings for example?


#10

yes it’s only connected to MySQL. what do you mean by skip-name-resolve?


#11

https://www.google.com/search?q=skip-name-resolve


#12

I have the same problem with win2008 r2, 16gb ram and mysql 5.7 and -skip… has no effect.


#13

I would check all relevant performance settings in CF and Lucee. I don’t know them all but that should be found on the documentation websites of CF and Lucee. Performance caching settings would be the first place to check.


#14

Make sure “INDEXING” is turned off for the drive(S) involved that are hosting the database
The database should be on its own volume


#15

I changed some of Lucee MySQL driver settings. Some of my queries were optimized but some of them (which are having AS statement) are still slow. How can I enable query caching in Lucee?


#16

You add the attribute cachedWithin={ TimeSpan } to your query call, e.g.

<cfquery cachedWithin="#createTimespan(1, 0, 0, 0)#" ...

#17

How can I apply query caching to all my queries in one go? Is there any general setting in Lucee? And one more question, is query caching enabled by default in Cold Fusion?


#18

Are you sure that you want to cache all of your queries?

If you are sure then there are different ways to go about that. One way to globally set the cachedWithin attribute default for all query tags in Application.cfc:

this.tag.query.cachedWithin = createTimespan(1, 0, 0, 0);

A better way will probably be to set the query results to the Application scope, e.g. in onApplicationStart() you execute the query and set it to the Application scope:

query name="Application.queries.someQuery" {
    echo("SELECT col1, col2 FROM table1");
}

A more modern approach will be to use a tool that will allow you to analyze which queries require caching, and pick and choose to cache the ones that you want. Check out ArgusCache from Rasia: https://www.arguscache.com/


#19

You can do few things.

Check out how much memory is used by Lucee in the process.

Follow the link and update the memory, if it is default.