For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data Layer Diagnostics

Diagnose cache performance, datasource health, slow SQL queries, and slow outbound HTTP/SOAP calls.

This guide covers how to diagnose data layer issues using the bx-mcp tools β€” cache performance, datasource connectivity, slow SQL queries, and slow outbound HTTP/SOAP calls.


πŸ—ƒοΈ Cache Analysis

View All Caches

curl -s http://localhost:8080/~bxmcp/boxlang.bxm \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-token" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"cache_get_all","arguments":{}},"id":"1"}'

Returns configuration, statistics, and status for every registered cache provider.

Cache Health Assessment

curl -s http://localhost:8080/~bxmcp/boxlang.bxm \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-token" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"cache_get_health","arguments":{}},"id":"1"}'

The health report flags issues like:

Issue
Severity
Trigger

CACHE_DISABLED

warning

Cache not enabled

CACHE_LOW_HIT_RATE

warning

Hit rate < 30%

CACHE_HIGH_EVICTIONS

warning

Evictions >= cache size (thrashing)

Detailed Cache Statistics

Cache Maintenance Operations


πŸ”Œ Datasource Connectivity

View All Datasources

Datasource Health Assessment

The health report flags issues like:

Issue
Severity
Trigger

DS_POOL_NOT_STARTED

warning

Pooling not started

DS_POOL_HIGH_UTILIZATION

warning

> 80% utilization

DS_POOL_SATURATED

critical

>= 95% utilization

DS_POOL_THREADS_AWAITING

warning

Waiting threads > 0

Test a Specific Connection

Returns success/failure with timing information to quickly identify connectivity issues.

Pool Metrics and Latency

The pool latency tool returns p50/p95/p99/max for acquire, usage, and creation times, plus timeout counts. Enable it in your configuration:

Requires BoxLang 1.14+ with ON_DATASOURCE_INITIALIZED event support.


🐒 Slow SQL Diagnosis

The bx-mcp module captures slow SQL queries automatically when slowSQL.enabled is true (default).

Configuration

View Captured Slow Queries

Aggregate Query Statistics

This groups captured queries by their original SQL and datasource, showing counts, average latency, and max latency.

Runtime Configuration


🌐 Slow HTTP/SOAP Diagnosis

The module captures slow outbound HTTP and SOAP calls automatically when slowHttp.enabled is true (default). Since SOAP calls transit through the same BoxHttpClient pipeline, they are captured automatically.

Configuration

View Captured Slow Calls

Aggregate Call Statistics

Groups slow calls by destination host with count, average latency, and max latency.

Runtime Configuration


πŸ“‹ Troubleshooting Example: Slow Application Response

Here's a systematic approach to diagnose a slow-responding application:

1. Check system health:

2. Look for slow queries:

3. Check for slow HTTP calls to downstream services:

4. Inspect connection pools:

5. Check for thread contention:


πŸ“š Next Steps

Last updated

Was this helpful?