grpc-node icon indicating copy to clipboard operation
grpc-node copied to clipboard

RESOURCE_EXHAUSTED

Open pranjal324 opened this issue 8 months ago • 6 comments

Problem description

Getting error after update to 1.13.1 RESOURCE_EXHAUSTED: Bandwidth exhausted or memory limit exceeded

Getting issue after some time when server is up on every request and resolve for some time when restart the server

when i downgrade , issue resolved

const grpc = require("@grpc/grpc-js"); const protoLoader = require("@grpc/proto-loader");

const PROTO_PATH = __dirname + "/node_cache.proto"; const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true }); const nodeCacheProto = grpc.loadPackageDefinition(packageDefinition).nodecache;

const cacheServerUrl = localhost:${process.env.CACHE_PORT || 10000};

export const gRPCclient = new nodeCacheProto.NodeCache(cacheServerUrl, grpc.credentials.createInsecure());

Environment

  • Node version - 16.17

Set Cache : ampHTML-/mahindra/global-pik-up?amp=1--en [1] Error: 8 RESOURCE_EXHAUSTED: Bandwidth exhausted or memory limit exceeded [1] at callErrorFromStatus (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/call.js:32:19) [1] at Object.onReceiveStatus (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/client.js:193:76) [1] at Object.onReceiveStatus (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:361:141) [1] at Object.onReceiveStatus (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:324:181) [1] at /data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/resolving-call.js:135:78 [1] at /data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/AbstractRunContextManager.js:95:49 [1] at BasicRunContextManager.with (/data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/BasicRunContextManager.js:55:17) [1] at wrapper (/data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/AbstractRunContextManager.js:95:23) [1] at processTicksAndRejections (node:internal/process/task_queues:78:11) [1] for call at [1] at ServiceClientImpl.makeUnaryRequest (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/client.js:161:32) [1] at ServiceClientImpl. (/data/cardekho/pwa/production/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19) [1] at Object.set (/data/cardekho/pwa/production/dist/src/utils/NodeCacheUtil.js:11:30) [1] at _callee3$ (/data/cardekho/pwa/production/dist/src/server-new3.js:554:41) [1] at tryCatch (/data/cardekho/pwa/production/dist/src/server-new3.js:43:1062) [1] at Generator. (/data/cardekho/pwa/production/dist/src/server-new3.js:43:3008) [1] at Generator.next (/data/cardekho/pwa/production/dist/src/server-new3.js:43:1699) [1] at asyncGeneratorStep (/data/cardekho/pwa/production/dist/src/server-new3.js:52:70) [1] at _next (/data/cardekho/pwa/production/dist/src/server-new3.js:53:163) [1] at /data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/AbstractRunContextManager.js:95:49 [1] at BasicRunContextManager.with (/data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/BasicRunContextManager.js:55:17) [1] at wrapper (/data/cardekho/pwa/production/node_modules/elastic-apm-node/lib/instrumentation/run-context/AbstractRunContextManager.js:95:23) [1] at runMicrotasks () [1] at processTicksAndRejections (node:internal/process/task_queues:96:5) { [1] code: 8, [1] details: 'Bandwidth exhausted or memory limit exceeded', [1] metadata: Metadata { internalRepr: Map(0) {}, options: {} }

pranjal324 avatar Apr 28 '25 12:04 pranjal324

Same here with 1.13.4 but unable to reproduce. Everything went well after rebooting.

bandwidth exhausted or memory limit exceeded

nofacer avatar Jul 02 '25 01:07 nofacer

I also have the same issue with 1.13.4, with the same resolution (downgrading back to 1.13.0)

jcbowman avatar Aug 28 '25 16:08 jcbowman

For anyone having this problem, would you mind trying with version 1.13.2? Looking through the changelog, the most likely change to have affected this is the change in 1.13.3 to disable Nagle's algorithm.

murgatroid99 avatar Sep 04 '25 21:09 murgatroid99

We had the same issue using 1.13.4. The downgrade fixed it.

As this issue was created after the release of 1.13.3: @pranjal324 is it possible that you actually used 1.13.3 as your package manager updated to the latest patch? (using a notation like ^1.13.1 in your package.json might do this)

jesko-plitt avatar Sep 24 '25 08:09 jesko-plitt

I suggest trying again with version 1.14.1. I fixed a regression that may be related to this error.

murgatroid99 avatar Nov 07 '25 20:11 murgatroid99

Update: Even after downgrading to 1.13.0/1.13.3, the issue remained. Setting the following values on the server side fixed the issue: InitialWindowSize, InitialConnWindowSize, MaxRecvMsgSize, MaxSendMsgSize and MaxConcurrentStreams. Therefore, a proper server configuration can also help to resolve the RESOURCE_EXHAUSTED error.

We will upgrade to 1.14.1 ASAP, but we haven't encountered the error again anyway. Note: our servers do not use this library as they are written in go.

jesko-plitt avatar Nov 10 '25 07:11 jesko-plitt