Lucee Command Box Install Page Load Speed Very Slow

We are running a small lightweight site on a windows 2022 server with 16gigs of memory. We used a command box install for lucee, we have set JVM Heap to 2048M. In looking at performance monitor, CPU and memory barely blip even on large queries, etc. The issue a simple page load of current date takes 2.62 seconds. Crazy! We have template caching on, etc., It appears that the server initial response time is what is taking so long.

Even more strange is that our development server is twice as fast which is a windows 2016 server, same memory and instance as production server but a different lucee version.
Lucee Version: 5.3.8+201

Don’t forget to tell us about your stack!

OS: Windows Server 2022 16gig memory AWS Instance T2.Xlarge
Java Version: ???
Tomcat Version: ???
Lucee Version: 5.3.0+160

try to install lucee with the binary or run lucee express.

you mean the initial page load, as in while the server is starting up?

subsequent pages are fast?

any anti-virus in play?

Not during startup/initialization. When i go to a test page with a simple current date CFML function, it takes almost 3 seconds.

Both are running the same services, both have windows anti-malware running. I am considering cloning the image of the faster server and just using that. We set them in the same way using commandbox start server

what do you see in task manager, flat chat cpu?

anything in the logs?

I find its rare unless you clone servers, that they are every the “same” even clones end up with slightly different neighbors, data centers and their own unique configurations.

Fire up cloudwatch, you should be able to see at least what your CPU is doing. Make sure that the service user has the correct permissions to the directories it needs to run your script(s), configure max-connections as by default its left to “unlimited” while the other setting " max-active-sessions" in your jboss config needs to be set to a realistic value. Additionally set the " max-header-size to a more realistic value as by default its 1MB.

CPU is relatively flat… just perking along between 1% and 5%. No crazy spikes, etc.

Where exactly do we set the max-header-size? Is that on lucee? Is in in the json file where we set max heap size? or is it in the /bin/boncodeajp13.settings?

You should understand that Lucee default uses Tomcat, commandbox Default, uses Jboss (Wildfly), you can look up the reference here Chapter 9. Undertow Subsystem Tuning Red Hat JBoss Enterprise Application Platform 7.1 | Red Hat Customer Portal As commandbox does its own thing, you can see how to setup the config here: Server Rules - CommandBox : CLI, Package Manager, REPL & More & what it references by checking the file located in Path\to\User\orWhereveryouhaveCommandbox.\CommandBox\cfml\system\config\server.schemea.json Thats why above, just TRY it on default install of Lucee, which uses Tomcat9,which just works and is regularly patched for security updates.

Terry, Thank you. We are new to Lucee. To install the default, are you saying do not use command box for the install? That is the only way we thought you could install it, however we did go through the boncode connector install.

Commandbox is great for DEV, it works well for some, but not all. I suggest trying the default installer for Lucee as Tomcat works well enough for most banks, the stock market, governments, and has a far larger resource pool to draw from for knowledge and troubleshooting than Jboss (Wildfly).

Thank you, i have installed lucee using the windows installer… I will test and report back. I see that when you use the windows installer it will automatically start the lucee service on reboot. That was not the case with the commandbox install and i had purchased their executable to start the service.

What happens if you log into your new windows server 2022 remotely and open the page directly on Tomcats port 8888 (bypassing IIS) locally from that machine? Same result?

If you are using Boncode to connect your instance to IIS then perhaps you are running into this common issue with AJP connections?

That’s for Tomcat installations though. With a Commandbox instance you could try editing your server.json so that the web.host value is 0.0.0.0

2 Likes

@Julian_Halliwell wow… that was it. very strange and now lightening fast. I am not sure what that does, but it worked.

2 Likes

I would just like to clarify this performance issue was in no way related to use of CommandBox. Its a common and known issue with Boncode. CommandBox is very stable and performant in production and is used by many people in production. I shared in the Into The Box keynote this morning a client running 1 Billion requests a month through their CommandBox-powered cluster. By all means, test different installs for comparison, but CommandBox is a viable production server. :slight_smile:

6 Likes

Brad, it has been running fast and flawlessly since we made that little change. Thank you for the insight.

2 Likes

With a CommandBox instance you could try editing your server.json so that the web.host value is 0.0.0.0

Thanks @Julian_Halliwell SO much for stating this so clearly.

I was aware of the fix for Tomcat but yours is the only clear reference for the equivalent fix for BonCode connecting to CommandBox/Undertow that I have found. And it works! Yay!
I’ve been stuck on this for an embarrassingly long time and had resolved that today was the day I gave up I switched back to the stand alone Lucee install. Glad I did one more search and found this.

The command for any future chumps like me :grin:

server set web.host=0.0.0.0

[EDIT] - Just to add; this works in concert with the BonCode setting (in BonCodeAJP13.settings)…

<MaxConnections>0</MaxConnections>
2 Likes