RESOURCE_EXHAUSTED
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.
Same here with 1.13.4 but unable to reproduce. Everything went well after rebooting.
bandwidth exhausted or memory limit exceeded
I also have the same issue with 1.13.4, with the same resolution (downgrading back to 1.13.0)
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.
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)
I suggest trying again with version 1.14.1. I fixed a regression that may be related to this error.
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.