lynkr 9.1.7 → 9.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lynkr",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.9",
|
|
4
4
|
"description": "Self-hosted Claude Code & Cursor proxy with Databricks,AWS BedRock,Azure adapters, openrouter, Ollama,llamacpp,LM Studio, workspace tooling, and MCP integration.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -44,11 +44,18 @@ class LoadShedder {
|
|
|
44
44
|
const memUsage = process.memoryUsage();
|
|
45
45
|
const heapUsedPercent = memUsage.heapUsed / memUsage.heapTotal;
|
|
46
46
|
|
|
47
|
-
if
|
|
47
|
+
// FIX: Only trigger if BOTH percentage is high AND actual usage is significant
|
|
48
|
+
// This prevents false positives on startup when heapTotal is small but will grow
|
|
49
|
+
const heapUsedMB = memUsage.heapUsed / (1024 * 1024);
|
|
50
|
+
const minHeapThresholdMB = 500; // Only shed load if using more than 500MB
|
|
51
|
+
|
|
52
|
+
if (heapUsedPercent > this.heapThreshold && heapUsedMB > minHeapThresholdMB) {
|
|
48
53
|
logger.warn(
|
|
49
54
|
{
|
|
50
55
|
heapUsedPercent: (heapUsedPercent * 100).toFixed(2),
|
|
56
|
+
heapUsedMB: heapUsedMB.toFixed(2),
|
|
51
57
|
threshold: (this.heapThreshold * 100).toFixed(2),
|
|
58
|
+
minThresholdMB: minHeapThresholdMB,
|
|
52
59
|
},
|
|
53
60
|
"Load shedding: Heap usage exceeded threshold"
|
|
54
61
|
);
|
|
@@ -96,6 +103,9 @@ class LoadShedder {
|
|
|
96
103
|
activeRequests: this.activeRequests,
|
|
97
104
|
totalShed: this.totalShed,
|
|
98
105
|
heapUsedPercent: ((memUsage.heapUsed / memUsage.heapTotal) * 100).toFixed(2),
|
|
106
|
+
heapUsedMB: (memUsage.heapUsed / (1024 * 1024)).toFixed(2),
|
|
107
|
+
heapTotalMB: (memUsage.heapTotal / (1024 * 1024)).toFixed(2),
|
|
108
|
+
rssMB: (memUsage.rss / (1024 * 1024)).toFixed(2),
|
|
99
109
|
rssPercent: ((memUsage.rss / os.totalmem()) * 100).toFixed(2),
|
|
100
110
|
thresholds: {
|
|
101
111
|
heapThreshold: (this.heapThreshold * 100).toFixed(2),
|
package/src/config/index.js
CHANGED
|
@@ -547,7 +547,7 @@ const workerTaskTimeoutMs = Number.parseInt(process.env.WORKER_TASK_TIMEOUT_MS ?
|
|
|
547
547
|
const workerOffloadThresholdBytes = Number.parseInt(process.env.WORKER_OFFLOAD_THRESHOLD_BYTES ?? "10000", 10);
|
|
548
548
|
|
|
549
549
|
var config = {
|
|
550
|
-
env: process.env.NODE_ENV ?? "
|
|
550
|
+
env: process.env.NODE_ENV ?? "production",
|
|
551
551
|
port: Number.isNaN(port) ? 8080 : port,
|
|
552
552
|
databricks: {
|
|
553
553
|
baseUrl: rawBaseUrl,
|