Comments (4)
this is a common one... blocking for 600ms
"1": " at TLSWrap.emitInitNative (node:internal/async_hooks:200:43)",
"2": " at TLSSocket._wrapHandle (node:_tls_wrap:696:24)",
"3": " at new TLSSocket (node:_tls_wrap:577:18)",
"4": " at Object.connect (node:_tls_wrap:1752:19)",
"5": " at Object.connect (node:internal/http2/core:3298:22)",
"6": " at /app/node_modules/@grpc/grpc-js/build/src/transport.js:504:35",
"7": " at new Promise (<anonymous>)",
"8": " at Http2SubchannelConnector.createSession (/app/node_modules/@grpc/grpc-js/build/src/transport.js:417:16)",
"9": " at /app/node_modules/@grpc/grpc-js/build/src/transport.js:557:112",
"10": " at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"message": "Event loop blocked for 699.5128900003433ms, operation started here:"
from grpc-node.
That last example shows the creation of a TLS socket. It's probably doing some encryption work, which takes time. This should only happen infrequently: one of the basic design principles of gRPC is that you establish a connection once and then use it to make several requests, so the time taken to establish the connection is amortized over all of the requests.
The other examples seem to have incomplete stack traces, so I don't think I can evaluate what happened with them.
from grpc-node.
i can show the full traces. the TLS establishment one happens a lot. i have a 10 minute log with a single instance running on google cloud. it happens 5000 times.
here's a full trace 400 non-io milliseconds to "sendMessageOnChild".
"data": [
{
"message": "Event loop blocked for 399.0506949999332ms, operation started here:"
},
[
" at AsyncHook.init (/app/node_modules/blocked-at/index.js:31:11)",
" at emitInitNative (node:internal/async_hooks:200:43)",
" at emitInitScript (node:internal/async_hooks:503:3)",
" at promiseInitHook (node:internal/async_hooks:322:3)",
" at promiseInitHookWithDestroyTracking (node:internal/async_hooks:326:3)",
" at Promise.then (<anonymous>)",
" at ResolvingCall.sendMessageOnChild (/app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:104:99)",
" at /app/node_modules/@grpc/grpc-js/build/src/resolving-call.js:192:22"
]
heck here's the full log:
you can see almost all the block-logs are "grpc doing stuff". not always TLS. not sure why TLS needs so much CPU with grpc, but not with our https:// rest requests - which never block.
from grpc-node.
I don't entirely understand how to interpret these logs. It's not clear what exactly qualifies as "blocking" the event loop. If it's any time spent in JS code, why are these stack traces called out specifically? And what exactly in the stack trace is the blocking time attributed to?
Also, if you have 5000 instances of blocking 400-600ms in 10 minutes, that's over half an hour of blocking total. I assume that means that there are multiple separate client instances. How many times does each client experience this in a 10 minute period?
from grpc-node.
Related Issues (20)
- Unable to use google.protobuf.Struct with @grpc/grpc-js HOT 1
- Grpc Unary calls not giving any response after client is in idle for some time(30mins) HOT 10
- can we provide a detailed tutorial of grpc-js-xds? HOT 1
- How to capture gRPC keep alives with tcpdump? HOT 2
- if the message has an optional field with a return value, the proto will attach a same name field with `_` prefix. why? HOT 2
- TypeError: The "original" argument must be of type Function | @grpc/grpc-js/build/src/resolver-dns.js HOT 3
- Exposing connection error reasons (ie, TLS failures) HOT 3
- Clarify build steps for v10+ HOT 2
- Discussion: Why HTTP2 pseudo headers such as :authory are removed from Metadata HOT 2
- Deadline examples/docs could use clarification HOT 8
- When response stream includes messages and then an error, final message(s) can be dropped HOT 1
- Servers base64-encode “grpc-status-details-bin” header with padding, but should be unpadded HOT 1
- Server does not check the HTTP method of the request HOT 2
- Compression handling has some issues
- Cardinality violations should use error code “unimplemented” HOT 3
- Servers send grpc-message trailer even when no error HOT 1
- successful calls still emit 'cancelled' as of v1.10.x HOT 2
- grpc-loader: Expose field options HOT 3
- `@grpc/grpc-js@latest` is pointing to an old version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-node.