I am having terrible slowness running a commandbox...
# box-products
j
I am having terrible slowness running a commandbox container on podman in a RHEL 9 host. Once the container is up and the servers are running, things seem to run fine, but any box command is painfully slow. In fact running box in the container just hangs and eventually causes the container to restart. I've tried just putting box on the host and it takes 10+ minutes to open the shell - it gets stuck on "Getting stable versioning information..." it seems. When the container is running, it doesn't look like anything else is taking up a lot of CPU or memory or anything. I'm pretty stumped. Has anyone seen something like this before?
Hmm setting offline mode in box made it start faster... maybe I can try that in the container
d
Not a guru on this, but it seems like there's a problem connecting to forgebox to check for latest, doesn't it? Firewall maybe? Can you connect to it in a browser from that machine?
j
Oh I didn't mention the host is not granted general internet access, so offlineMode should probably be used here. I just didn't expect that to cause such massive slowness
d
Probably has to wait to time out every call, which, slow!!!
j
This doesn't seem to be helping in the container. Other containers run just fine, so I'm not sure what is special about the CommandBox one...
b
Yes, I assume the HTTP calls are just timing out
Please note, offline mode will be obeyed by CommandBox, BUT Lucee may still download things all willy-nilly
If you want to know what the container is doing, ssh in and run
jstack
on the Java PID and you'll have your answer lickety split.
@John Liljegren
j
how do i find that PID? ps doesn't work in the container
b
I find it hard to believe
ps
doesn't work, but I'm sure you can install whatever you need for it to work
Even alpine, which is the most pared-down docker image I know, has a
ps
command, lol
j
The container didn't have ps, top, nor jstack... the Dockerfile started with
FROM ortussolutions/commandbox:3.4.5
. I modified it to start with
FROM ortussolutions/commandbox:lucee5-ubi9-3.7.2
and it is no longer painfully slow. Not sure if it's the ubi image that helped or simply upgrading, but wanted to close the thread on this. Thanks for the help!
b
Well, that doesn't really close the thread as we don't know what the issue was, it just means you bypassed it
I'm still confused why you didn't just install ps
The true answer to this question still remains the answer I gave you 19 days ago, which is to put
jstack
on the container and see what the JVM process is doing.
j
Ah I thought you were saying it was already installed in the image. The host is blocked from external resources so I couldn't reach a package manager, and I didn't have time to further spend on it. Just grabbing a different base image was a quick and easy attempt, and it worked, so the thread is closed for me! If I get more time I'll look into it again, but at this point I consider that very low likelihood. Thanks again
b
The host is blocked from external resources
Then the issue is 99% likely that Lucee was downloading crap on first start. This is something that Lucee isn't "supposed" to do, but it does nonetheless
When your machine doesn't have external internet access, Lucee's internal HTTP calls will hang for up to 60 seconds apiece in my experience.
j
Lucee hanging doesn't explain why simply running box in the container would hang for 5+ minutes though
b
Of course it does
Do you not realize CommandBox is powered by Lucee?
In order for
box
to start, Lucee must start
j
i didn't realize that no! i knew there was an embedded lucee server, but not that it was running the box cli
b
Yep, it's not a "server" in the sense that it's a web server. It's just JSR-223 execution of CFML from the command line via the Lucee engine
That's why the
info
Command shows a Lucee version
And how Task Runners, the REPL, and CFML functions from the CLI wortk 🙂
If you set
Copy code
LUCEE_ENABLE_BUNDLE_DOWNLOAD=false
as an env var prior to starting CommandBox, it will probably error out right away
Unless its downloading extensions, but Lucee doesn't usually do that unless you're using the
LUCEE_EXTENSIONS
env var
Setting
Copy code
LUCEE_EXTENSIONS_INSTALL=false
is supposed to stop that however