Web server data
On this page
Web server data
What the Web server page can read, on which runtime, and where each fact comes from. It was found by reading the sources and by running MiniServer. Nothing is guessed: a value a runtime does not report is shown as "not reported".
How it was checked:
| Runtime | How | Status |
|---|---|---|
| MiniServer | Source of ortus-boxlang/boxlang-miniserver (commit 739b45e) and a running MiniServer 1.19.0 (JMX and reflection from a template) | Verified |
| CommandBox | Source of Ortus-Solutions/commandbox (4471d2b) and Ortus-Solutions/runwar (bd9e829). No CommandBox was started. | Read from source, not run |
| Servlet containers (Tomcat, Jetty, WildFly) | Public behavior of those products, not their source | Unverified |
Which runtime is this
| Runtime | How BxLens tells | Evidence |
|---|---|---|
| MiniServer | The main class is ortus.boxlang.web.MiniServer (the sun.java.command property starts with it), or the class loads and MiniServer.getServerInstance() is not null. | MiniServer.java:96 (class), :400 (getServerInstance). Running: sun.java.command was ortus.boxlang.web.MiniServer --webroot ... --host ... --port .... The class loads from the module class loader. |
| CommandBox | The JVM is started as java ... -cp <jars> runwar.Start <serverInfo.json>, so sun.java.command starts with runwar.Start; the class runwar.Server is also on the class path. | ServerService.cfc:1497 appends runwar.Start and the serverInfo.json path to the argument list; Start.java:37 reads that single argument. |
| Servlet container | Tomcat: property catalina.base or catalina.home. Jetty: jetty.home or jetty.base. WildFly: jboss.home.dir. Other: the servlet API class is present and a web request was seen. | Property names are the ones those products document. Not verified here. |
| CLI | None of the above and no web request seen. |
CommandBox does not tell the server process its own version. The page shows the Runwar version (runwar.Server.getVersion(), Server.java:727).
What is readable, per runtime
| Fact | MiniServer | CommandBox (Runwar) | Servlet container |
|---|---|---|---|
| Server name | not available (MiniServer has no server name) | name key of serverInfo.json | not read |
| Version | MiniServer.getVersionInfo(), key version (MiniServer.java:728) | Runwar version only | Tomcat ServerInfo.getServerNumber(), Jetty Jetty.VERSION (unverified) |
| Listeners, bind address, connection count | XNIO MXBeans, see below | same MXBeans (same XNIO library, not run) | none from XNIO; Tomcat has its own MBeans, not read |
| Protocol of a listener (http or https) | Undertow.ListenerInfo.getProtcol() via MiniServer.getServerInstance() | ports under listeners.http and listeners.ssl of serverInfo.json | not read |
| Ports | from the bind addresses | from the bind addresses | not read |
| Web root | MiniServer.resourceManager (MiniServer.java:121) when it is a PathResourceManager: getBasePath(). Not available when URL aliases wrap it in an AliasResourceManager. | webroot key of serverInfo.json | not read |
| Rewrites | not readable (see below) | rewritesEnable key of serverInfo.json | not read |
| Started at | not available | not read (serverInfo.json has a CFML date string, not parsed) | not read |
| Worker threads, queue | XNIO worker MXBean | same MXBean (not run) | not read |
| Busy worker threads | not reported (the MXBean answers -1) | not reported (same library) | not read |
| Bytes sent | ConnectorStatistics.getBytesSent() through the listener info, summed | not reachable (see below) | not read |
| Requests, 5xx, slowest, active, per second | BxLens counters | BxLens counters | BxLens counters |
The request numbers of BxLens count the requests that reached BoxLang. The bytes sent of MiniServer count everything the connector served, static files included, so the two do not match.
MiniServer
Everything below was seen on a running MiniServer 1.19.0.
- Public static accessors (
MiniServer.java):getServerInstance()returns theio.undertow.Undertow,getWorker()theXnioWorker,getActiveRequests()a count of every request in the handler chain,getMetricsHandler()theMetricsHandler,getVersionInfo()the version. BxLens calls the first, the version and theresourceManagerfield by reflection, with no compile dependency. - Connector statistics are on.
MiniServerConfig.java:128putsENABLE_STATISTICS = truein the default Undertow options, "required for connector statistics exposed by health checks". TheConnectorStatisticsobject is reached throughgetServerInstance().getListenerInfo().get(i).getConnectorStatistics(). It has request count, error count, bytes sent and received, active connections and active requests. Undertow does not publish it over JMX, so reflection onMiniServeris the only way. A user can switch it off inminiserver.json(undertowOptions), then the object is null and "bytes sent" is not reported. - MXBeans (name, then the attributes read):
org.xnio:type=Xnio,provider="nio",worker="XNIO-1":IoThreadCount4,CoreWorkerPoolSize32,MaxWorkerPoolSize32,WorkerPoolSize1,WorkerQueueSize0,BusyWorkerThreadCount-1.org.xnio:type=Xnio,provider="nio",worker="XNIO-1",address="/127.0.0.1:8130":BindAddress,ConnectionCount,ConnectionLimitHighWaterandConnectionLimitLowWater(both 2147483647, which means unlimited).jboss.threads:name="XNIO-1",type=thread-pool:PoolSize,CorePoolSize,MaximumPoolSize,QueueSize,MaximumQueueSize(2147483647, unbounded);ActiveCount,CompletedTaskCount,LargestPoolSize,SubmittedTaskCountandRejectedTaskCountare -1.org.xnio:type=Xnio,provider="nio": provider name and XNIO version (3.8.16.Final).
- Busy workers are not readable.
BusyWorkerThreadCountis -1 on thenioprovider and so isActiveCounton the pool. MiniServer's own health endpoint (HealthCheckHandler.java:196) reports the same -1 asbusy. BxLens shows "not reported" and never fills it in from the in-flight list. - Rewrites are not readable. The configuration (
MiniServerConfig) is a local variable ofmainand is not kept; the rewrite handler is wrapped into the handler chain atMiniServer.java:560and nothing exposes it. The--rewritesflag is on the command line only when it was given there, and its absence proves nothing (miniserver.jsoncan enable it). - No server name, no start time.
HealthCheckHandlerkeeps its own start time in an instance field. The JVM start time is on the JVM page and is not the server start.
CommandBox (Runwar), read from source
CommandBox starts the server as a separate JVM (ServerService.cfc:1480-1500), so the BoxLang in it runs inside the Runwar process.
- Connector statistics are off and not reachable. Runwar never sets
ENABLE_STATISTICS(a search ofrunwar/src/mainfinds no use ofENABLE_STATISTICSorConnectorStatistics). A user can add it inserver.jsonunderrunwar.undertowOptions(ConfigParser.java:288), which Runwar applies withsetServerOption(Server.java:459). Either way theUndertowobject is the private instance fieldServer.undertow(Server.java:78) of an object that onlyStart.mainholds, so it cannot be reached from the application. Bytes sent is not reported. - MXBeans. Runwar builds its listeners with
Undertow.builder(), so XNIO registers the same worker and listener MXBeans as under MiniServer. Not run. Runwar creates a second worker,XNIO-2, for the access log when access logging is on (SiteDeployment.java:299); it has no listener, and BxLens takes the worker that owns the listeners. - Worker size. Left to Undertow unless
maxRequestsis set inserver.json(Server.java:292,setWorkerThreads). - The
serverInfo.jsonfile. Its path is the only argument ofrunwar.Start. It holds the server definition and also secrets (SSLKeyPass,AJPSecret,ModCFMLSharedKey,basicAuthUsers). BxLens reads it only when the command line is arunwar.Startline, up to 2 MB, and copies outname,webroot,rewritesEnableand theportof each entry underlisteners.httpandlisteners.ssl. Every other key is dropped before anything is kept. The keys exist inServerService.cfc(the defaults at lines 3540-3660) andConfigParser.java. - Servlet context. Runwar names the deployment
WildFly / Undertow(Server.java:321), which is whatServletContext.getServerInfo()reports. BxLens does not use it, because it needs a servlet request.
What is not readable anywhere
| Fact | Why |
|---|---|
| Busy worker threads (MiniServer, and so CommandBox) | The XNIO nio provider and jboss-threads report -1. |
| Connection limit | Unlimited by default (2147483647). It is shown only when a real limit is set. |
| Rewrites, on MiniServer | Not kept by the server. |
| Start time of the server | Neither server exposes it. |
| Bytes sent on CommandBox | Statistics are off by default and the Undertow object is private. |
| CommandBox version | Not passed to the server process. |
| Anything of Tomcat, Jetty or WildFly beyond name and version | Not read. Tomcat has MBeans (Catalina:type=ThreadPool, Catalina:type=GlobalRequestProcessor) that a later version can read the same way as XNIO's; they were not checked. |