JOHN SILLVESTOR commited on
Commit
1de6448
·
verified ·
1 Parent(s): 0f32bb5

Harden stream server and speed up video delivery

Browse files
Files changed (5) hide show
  1. .dockerignore +13 -0
  2. Dockerfile +6 -5
  3. package-lock.json +225 -32
  4. package.json +5 -2
  5. server.js +2 -4
.dockerignore CHANGED
@@ -1,3 +1,16 @@
1
  node_modules
 
 
 
2
  .venv
 
 
 
 
 
 
 
 
3
  *.md.bak
 
 
 
1
  node_modules
2
+ .git
3
+ .gitignore
4
+ .wrangler
5
  .venv
6
+ *.log
7
+ npm-debug.log*
8
+ README.md
9
+ posters
10
+ coverage
11
+ .cache
12
+ .DS_Store
13
+ Thumbs.db
14
  *.md.bak
15
+ Dockerfile
16
+ .dockerignore
Dockerfile CHANGED
@@ -1,17 +1,18 @@
1
  FROM node:22-bookworm-slim
2
  RUN apt-get update \
3
- && apt-get install -y --no-install-recommends ffmpeg ca-certificates \
4
  && rm -rf /var/lib/apt/lists/*
5
  WORKDIR /app
6
- COPY --chown=node:node package.json ./
7
- RUN npm install --omit=dev --no-audit --no-fund
 
8
  COPY --chown=node:node server.js ./
9
  USER node
10
  ENV HOME=/home/node
11
- ENV NODE_ENV=production
12
  ENV PORT=7860
13
  ENV UV_THREADPOOL_SIZE=4
14
  ENV NODE_OPTIONS=--max-old-space-size=4096
15
  EXPOSE 7860
 
16
  HEALTHCHECK --interval=45s --timeout=5s --start-period=50s --retries=3 CMD node -e "fetch('http://127.0.0.1:7860/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
17
- CMD ["node","--max-old-space-size=4096","server.js"]
 
1
  FROM node:22-bookworm-slim
2
  RUN apt-get update \
3
+ && apt-get install -y --no-install-recommends ca-certificates \
4
  && rm -rf /var/lib/apt/lists/*
5
  WORKDIR /app
6
+ ENV NODE_ENV=production
7
+ COPY --chown=node:node package.json package-lock.json ./
8
+ RUN npm ci --omit=dev --no-audit --no-fund
9
  COPY --chown=node:node server.js ./
10
  USER node
11
  ENV HOME=/home/node
 
12
  ENV PORT=7860
13
  ENV UV_THREADPOOL_SIZE=4
14
  ENV NODE_OPTIONS=--max-old-space-size=4096
15
  EXPOSE 7860
16
+ STOPSIGNAL SIGTERM
17
  HEALTHCHECK --interval=45s --timeout=5s --start-period=50s --retries=3 CMD node -e "fetch('http://127.0.0.1:7860/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
18
+ CMD ["node","server.js"]
package-lock.json CHANGED
@@ -7,12 +7,148 @@
7
  "name": "dublk-studio",
8
  "dependencies": {
9
  "big-integer": "1.6.52",
10
- "teleproto": "1.228.5"
11
  },
12
  "engines": {
13
  "node": ">=22"
14
  }
15
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  "node_modules/big-integer": {
17
  "version": "1.6.52",
18
  "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz",
@@ -22,11 +158,68 @@
22
  "node": ">=0.6"
23
  }
24
  },
25
- "node_modules/graceful-fs": {
26
- "version": "4.2.11",
27
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
28
- "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
29
- "license": "ISC"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  },
31
  "node_modules/imurmurhash": {
32
  "version": "0.1.4",
@@ -59,24 +252,27 @@
59
  }
60
  },
61
  "node_modules/node-localstorage": {
62
- "version": "2.2.1",
63
- "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.2.1.tgz",
64
- "integrity": "sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw==",
65
  "license": "MIT",
66
  "dependencies": {
67
- "write-file-atomic": "^1.1.4"
68
  },
69
  "engines": {
70
  "node": ">=0.12"
71
  }
72
  },
73
- "node_modules/slide": {
74
- "version": "1.1.6",
75
- "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz",
76
- "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==",
77
  "license": "ISC",
78
  "engines": {
79
- "node": "*"
 
 
 
80
  }
81
  },
82
  "node_modules/smart-buffer": {
@@ -103,23 +299,18 @@
103
  "npm": ">= 3.0.0"
104
  }
105
  },
106
- "node_modules/store2": {
107
- "version": "2.14.4",
108
- "resolved": "https://registry.npmjs.org/store2/-/store2-2.14.4.tgz",
109
- "integrity": "sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==",
110
- "license": "MIT"
111
- },
112
  "node_modules/teleproto": {
113
- "version": "1.228.5",
114
- "resolved": "https://registry.npmjs.org/teleproto/-/teleproto-1.228.5.tgz",
115
- "integrity": "sha512-NMBFB4oB+0mjJIPVqdLd3wAaU7kf5dw7frrYdnnXM38DSdbnN36Dao6Ae1xNZR9NICiefbfJqM8yDijOPqE8MA==",
116
  "license": "MIT",
117
  "dependencies": {
118
  "big-integer": "^1.6.48",
 
 
119
  "mime": "^3.0.0",
120
- "node-localstorage": "^2.2.1",
121
- "socks": "^2.6.2",
122
- "store2": "^2.13.0"
123
  },
124
  "engines": {
125
  "node": ">=18"
@@ -130,14 +321,16 @@
130
  }
131
  },
132
  "node_modules/write-file-atomic": {
133
- "version": "1.3.4",
134
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz",
135
- "integrity": "sha512-SdrHoC/yVBPpV0Xq/mUZQIpW2sWXAShb/V4pomcJXh92RuaO+f3UTWItiR3Px+pLnV2PvC2/bfn5cwr5X6Vfxw==",
136
  "license": "ISC",
137
  "dependencies": {
138
- "graceful-fs": "^4.1.11",
139
  "imurmurhash": "^0.1.4",
140
- "slide": "^1.1.5"
 
 
 
141
  }
142
  }
143
  }
 
7
  "name": "dublk-studio",
8
  "dependencies": {
9
  "big-integer": "1.6.52",
10
+ "teleproto": "1.233.0"
11
  },
12
  "engines": {
13
  "node": ">=22"
14
  }
15
  },
16
+ "node_modules/@cifrante/darwin-arm64": {
17
+ "version": "0.8.1",
18
+ "resolved": "https://registry.npmjs.org/@cifrante/darwin-arm64/-/darwin-arm64-0.8.1.tgz",
19
+ "integrity": "sha512-CSHC3rayWsjNWWa0FxQe5nCVKa5TKCurTPnj00EZxk7y6P+1ApFUdB8Qdsw1HcVR1trSO8arvYc31R2y6LZWRQ==",
20
+ "cpu": [
21
+ "arm64"
22
+ ],
23
+ "license": "MIT",
24
+ "optional": true,
25
+ "os": [
26
+ "darwin"
27
+ ]
28
+ },
29
+ "node_modules/@cifrante/darwin-x64": {
30
+ "version": "0.8.1",
31
+ "resolved": "https://registry.npmjs.org/@cifrante/darwin-x64/-/darwin-x64-0.8.1.tgz",
32
+ "integrity": "sha512-UROiCYX3a3xyQBy3LOMH4TnzkTWoCtmEjETCpWb1PPiIEeE/rAjFh9831XlR9ZfrUg0TUysPcV5sBju3EHrK7w==",
33
+ "cpu": [
34
+ "x64"
35
+ ],
36
+ "license": "MIT",
37
+ "optional": true,
38
+ "os": [
39
+ "darwin"
40
+ ]
41
+ },
42
+ "node_modules/@cifrante/linux-arm64-gnu": {
43
+ "version": "0.8.1",
44
+ "resolved": "https://registry.npmjs.org/@cifrante/linux-arm64-gnu/-/linux-arm64-gnu-0.8.1.tgz",
45
+ "integrity": "sha512-6OvNHT6hrBupku8PBCF2yGC0133KdaKpaHDz7w2N18nwewjFqdRaX5DDBoUusqzO7f4bfX1a36oYWArNeMfVqQ==",
46
+ "cpu": [
47
+ "arm64"
48
+ ],
49
+ "libc": [
50
+ "glibc"
51
+ ],
52
+ "license": "MIT",
53
+ "optional": true,
54
+ "os": [
55
+ "linux"
56
+ ]
57
+ },
58
+ "node_modules/@cifrante/linux-arm64-musl": {
59
+ "version": "0.8.1",
60
+ "resolved": "https://registry.npmjs.org/@cifrante/linux-arm64-musl/-/linux-arm64-musl-0.8.1.tgz",
61
+ "integrity": "sha512-o8rrO4olBigzSvCXssyByP+5JUSuniN//OIM3FVkMY9oYXkoZcTBTCmsC45ggZlhcUAxK/+HxMfWJ2n4QApE5Q==",
62
+ "cpu": [
63
+ "arm64"
64
+ ],
65
+ "libc": [
66
+ "musl"
67
+ ],
68
+ "license": "MIT",
69
+ "optional": true,
70
+ "os": [
71
+ "linux"
72
+ ]
73
+ },
74
+ "node_modules/@cifrante/linux-x64-gnu": {
75
+ "version": "0.8.1",
76
+ "resolved": "https://registry.npmjs.org/@cifrante/linux-x64-gnu/-/linux-x64-gnu-0.8.1.tgz",
77
+ "integrity": "sha512-qP7FBxZb25WUlXZcX4I6cT62H41YxEaGGkvoo/NzJNL2Wezk0ifJpylFUoiXnxsVmyyhtWZ7EcaFDwHthmo2Eg==",
78
+ "cpu": [
79
+ "x64"
80
+ ],
81
+ "libc": [
82
+ "glibc"
83
+ ],
84
+ "license": "MIT",
85
+ "optional": true,
86
+ "os": [
87
+ "linux"
88
+ ]
89
+ },
90
+ "node_modules/@cifrante/linux-x64-musl": {
91
+ "version": "0.8.1",
92
+ "resolved": "https://registry.npmjs.org/@cifrante/linux-x64-musl/-/linux-x64-musl-0.8.1.tgz",
93
+ "integrity": "sha512-p1A/uhcsB8nLb5b6yEBlMOFAR21GgBscHjp0BCie5iz8PGp/Ty5GvAuh+9nNeY4bube5Gy6iUDC7OXkpG4TdwA==",
94
+ "cpu": [
95
+ "x64"
96
+ ],
97
+ "libc": [
98
+ "musl"
99
+ ],
100
+ "license": "MIT",
101
+ "optional": true,
102
+ "os": [
103
+ "linux"
104
+ ]
105
+ },
106
+ "node_modules/@cifrante/win32-arm64": {
107
+ "version": "0.8.1",
108
+ "resolved": "https://registry.npmjs.org/@cifrante/win32-arm64/-/win32-arm64-0.8.1.tgz",
109
+ "integrity": "sha512-VxkF/WJlDeeq5oY5T9fX632TzqN7yJ0KW6Xc4AA0PKSKi5EfFuBmVlpkShnQOBg5zkCJ7D02Yrm6xz1ByNm/8w==",
110
+ "cpu": [
111
+ "arm64"
112
+ ],
113
+ "license": "MIT",
114
+ "optional": true,
115
+ "os": [
116
+ "win32"
117
+ ]
118
+ },
119
+ "node_modules/@cifrante/win32-x64": {
120
+ "version": "0.8.1",
121
+ "resolved": "https://registry.npmjs.org/@cifrante/win32-x64/-/win32-x64-0.8.1.tgz",
122
+ "integrity": "sha512-GGxGANoFAfe1VCkFcsAaHyFNCnP6DKFcKG6RJRabGDQRuoDT55Uy/bqn72r9azchcDCkcckz385+M9WTmBb72g==",
123
+ "cpu": [
124
+ "x64"
125
+ ],
126
+ "license": "MIT",
127
+ "optional": true,
128
+ "os": [
129
+ "win32"
130
+ ]
131
+ },
132
+ "node_modules/base64-js": {
133
+ "version": "1.5.1",
134
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
135
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
136
+ "funding": [
137
+ {
138
+ "type": "github",
139
+ "url": "https://github.com/sponsors/feross"
140
+ },
141
+ {
142
+ "type": "patreon",
143
+ "url": "https://www.patreon.com/feross"
144
+ },
145
+ {
146
+ "type": "consulting",
147
+ "url": "https://feross.org/support"
148
+ }
149
+ ],
150
+ "license": "MIT"
151
+ },
152
  "node_modules/big-integer": {
153
  "version": "1.6.52",
154
  "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz",
 
158
  "node": ">=0.6"
159
  }
160
  },
161
+ "node_modules/buffer": {
162
+ "version": "6.0.3",
163
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
164
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
165
+ "funding": [
166
+ {
167
+ "type": "github",
168
+ "url": "https://github.com/sponsors/feross"
169
+ },
170
+ {
171
+ "type": "patreon",
172
+ "url": "https://www.patreon.com/feross"
173
+ },
174
+ {
175
+ "type": "consulting",
176
+ "url": "https://feross.org/support"
177
+ }
178
+ ],
179
+ "license": "MIT",
180
+ "dependencies": {
181
+ "base64-js": "^1.3.1",
182
+ "ieee754": "^1.2.1"
183
+ }
184
+ },
185
+ "node_modules/cifrante": {
186
+ "version": "0.8.1",
187
+ "resolved": "https://registry.npmjs.org/cifrante/-/cifrante-0.8.1.tgz",
188
+ "integrity": "sha512-6IKK0R5Ur37hgktw1KyJO14jIMpjcj0q5H+gSt/Xev9aYNv7k7cOLNCXHFzNNOR3jbot2d+6ae/dqvS+7Ebtaw==",
189
+ "license": "MIT",
190
+ "engines": {
191
+ "node": ">=18"
192
+ },
193
+ "optionalDependencies": {
194
+ "@cifrante/darwin-arm64": "0.8.1",
195
+ "@cifrante/darwin-x64": "0.8.1",
196
+ "@cifrante/linux-arm64-gnu": "0.8.1",
197
+ "@cifrante/linux-arm64-musl": "0.8.1",
198
+ "@cifrante/linux-x64-gnu": "0.8.1",
199
+ "@cifrante/linux-x64-musl": "0.8.1",
200
+ "@cifrante/win32-arm64": "0.8.1",
201
+ "@cifrante/win32-x64": "0.8.1"
202
+ }
203
+ },
204
+ "node_modules/ieee754": {
205
+ "version": "1.2.1",
206
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
207
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
208
+ "funding": [
209
+ {
210
+ "type": "github",
211
+ "url": "https://github.com/sponsors/feross"
212
+ },
213
+ {
214
+ "type": "patreon",
215
+ "url": "https://www.patreon.com/feross"
216
+ },
217
+ {
218
+ "type": "consulting",
219
+ "url": "https://feross.org/support"
220
+ }
221
+ ],
222
+ "license": "BSD-3-Clause"
223
  },
224
  "node_modules/imurmurhash": {
225
  "version": "0.1.4",
 
252
  }
253
  },
254
  "node_modules/node-localstorage": {
255
+ "version": "3.0.5",
256
+ "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-3.0.5.tgz",
257
+ "integrity": "sha512-GCwtK33iwVXboZWYcqQHu3aRvXEBwmPkAMRBLeaX86ufhqslyUkLGsi4aW3INEfdQYpUB5M9qtYf3eHvAk2VBg==",
258
  "license": "MIT",
259
  "dependencies": {
260
+ "write-file-atomic": "^5.0.1"
261
  },
262
  "engines": {
263
  "node": ">=0.12"
264
  }
265
  },
266
+ "node_modules/signal-exit": {
267
+ "version": "4.1.0",
268
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
269
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
270
  "license": "ISC",
271
  "engines": {
272
+ "node": ">=14"
273
+ },
274
+ "funding": {
275
+ "url": "https://github.com/sponsors/isaacs"
276
  }
277
  },
278
  "node_modules/smart-buffer": {
 
299
  "npm": ">= 3.0.0"
300
  }
301
  },
 
 
 
 
 
 
302
  "node_modules/teleproto": {
303
+ "version": "1.233.0",
304
+ "resolved": "https://registry.npmjs.org/teleproto/-/teleproto-1.233.0.tgz",
305
+ "integrity": "sha512-7Ck4Jou40a1agacJWZkK7sTsXnyWzLUAMHwktlnqpBT4mmBzHsLwXskEEDeuTuEz6lMygw9FjYyD1m0MlgoS0A==",
306
  "license": "MIT",
307
  "dependencies": {
308
  "big-integer": "^1.6.48",
309
+ "buffer": "^6.0.3",
310
+ "cifrante": "0.8.1",
311
  "mime": "^3.0.0",
312
+ "node-localstorage": "^3.0.5",
313
+ "socks": "^2.6.2"
 
314
  },
315
  "engines": {
316
  "node": ">=18"
 
321
  }
322
  },
323
  "node_modules/write-file-atomic": {
324
+ "version": "5.0.1",
325
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz",
326
+ "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==",
327
  "license": "ISC",
328
  "dependencies": {
 
329
  "imurmurhash": "^0.1.4",
330
+ "signal-exit": "^4.0.1"
331
+ },
332
+ "engines": {
333
+ "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
334
  }
335
  }
336
  }
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "dublk-studio",
3
- "description": "Node.js HTTP API for the DUBLK blog demo",
4
  "private": true,
5
  "type": "commonjs",
6
  "engines": {
@@ -8,6 +8,9 @@
8
  },
9
  "dependencies": {
10
  "big-integer": "1.6.52",
11
- "teleproto": "1.228.5"
 
 
 
12
  }
13
  }
 
1
  {
2
  "name": "dublk-studio",
3
+ "description": "Node.js streaming API for DUB LK 2000",
4
  "private": true,
5
  "type": "commonjs",
6
  "engines": {
 
8
  },
9
  "dependencies": {
10
  "big-integer": "1.6.52",
11
+ "teleproto": "1.233.0"
12
+ },
13
+ "scripts": {
14
+ "start": "node server.js"
15
  }
16
  }
server.js CHANGED
@@ -40,7 +40,7 @@ function cgroupLimitBytes() {
40
  }
41
  const CGROUP_BYTES = cgroupLimitBytes();
42
  const RAM_BYTES = CGROUP_BYTES || os.totalmem() || (16 * 1024 * MB);
43
- const CHUNK_SIZE = 256 * 1024;
44
  const HOT_HEAD = 32 * MB;
45
  const HOT_TAIL = 12 * MB;
46
  const STREAM_WINDOW = 32 * MB;
@@ -48,7 +48,7 @@ const PROBE_HEAD = 8 * MB;
48
  const BOT_MAX = 100;
49
  const PIPE_FIRST_MS = 60000;
50
  const PIPE_IDLE_MS = 22000;
51
- const PIPE_MAX_MS = 3 * 60 * 60 * 1000;
52
  const RANGE_LOOKAHEAD = 8;
53
  const WARM_AHEAD = 6;
54
  const WARM_BUDGET_BYTES = 128 * MB;
@@ -1569,8 +1569,6 @@ class SingleFlight {
1569
  }
1570
  const chunkFlight = new SingleFlight();
1571
  let diskBytesUsed = 0;
1572
- let ffmpegReady = null;
1573
-
1574
 
1575
  const SLICE_MEM_MAX = Math.max(1024, Math.min(6144, Math.floor((RAM_BYTES * 0.38) / MB)));
1576
  const sliceMemCache = new Map();
 
40
  }
41
  const CGROUP_BYTES = cgroupLimitBytes();
42
  const RAM_BYTES = CGROUP_BYTES || os.totalmem() || (16 * 1024 * MB);
43
+ const CHUNK_SIZE = 512 * 1024;
44
  const HOT_HEAD = 32 * MB;
45
  const HOT_TAIL = 12 * MB;
46
  const STREAM_WINDOW = 32 * MB;
 
48
  const BOT_MAX = 100;
49
  const PIPE_FIRST_MS = 60000;
50
  const PIPE_IDLE_MS = 22000;
51
+ const PIPE_MAX_MS = 6 * 60 * 60 * 1000;
52
  const RANGE_LOOKAHEAD = 8;
53
  const WARM_AHEAD = 6;
54
  const WARM_BUDGET_BYTES = 128 * MB;
 
1569
  }
1570
  const chunkFlight = new SingleFlight();
1571
  let diskBytesUsed = 0;
 
 
1572
 
1573
  const SLICE_MEM_MAX = Math.max(1024, Math.min(6144, Math.floor((RAM_BYTES * 0.38) / MB)));
1574
  const sliceMemCache = new Map();