Answer the question
In order to leave comments, you need to log in
Is it possible to pass a socket file descriptor from Go to Node.js?
There is a web server written in Go
. HTTP requests and web sockets can come to the server.
Some of the http requests are processed by the server itself, and some are given to the process on node.js, all web sockets are sent to node.js
Now this is all implemented as a reverse proxy, which doubles the number of connections + proxy costs.
Is it possible to give the socket itself directly to the process on node.js through forwarding the descriptor file?
Task:
There is an application on the node, it was not written by me, it works in 1 process.
My task is, firstly, to run it on all processor cores, and secondly, to cache statics in memory.
At first I thought to just do balancing through ngnix or cluster, but there is a problem that we need smarter balancing - session-stiky + new sessions have some distribution
conditions memory and periodically checks the need to update the cache, and requests to the dynamics are proxyed to one of the application processes, and now we need to optimize the whole thing so that "long-term" requests, such as websockets, are not proxyed, but simply give an open connection to the node
Answer the question
In order to leave comments, you need to log in
No. And what does "The server processes part of the http requests itself, and gives part to the process on node.js", who gives it, who processes it? Do you have nginx on the go / node level and at the location level it proxies a part to go, and everything flies to node or go, and it sends it somewhere else?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question