Reputation: 11352
I have socket.io running on my website. As I'm reading the server logs, I see many lines like this:
at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=aIngEEcxyyq0IZa7ABdN" service=15672ms status=101 bytes=129 protocol=https
at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=K8sqpqsEh7rRWbk4ABcK" connect=0ms service=256166ms status=101 bytes=175 protocol=https
at=info method=GET path="/socket.io/?EIO=3&transport=websocket&sid=OyeTNvf0X7luR4xaAAID" connect=1ms service=13821612ms status=101 bytes=150511 protocol=https
As you can see, the service
time (not sure what that even means but it's read in my logs) is super high.
What could be the causes of long service times for socket.io pings?
Upvotes: 0
Views: 35
Reputation: 707318
socket.io is supposed to have a long connection time. The whole idea is that the client connects to the server, keeps the connection open for awhile (often the duration of the page) and then sends/receives messages over that connection.
In case you didn't realize it, a request such as this:
method=GET path="/socket.io/?EIO=3&transport=websocket&sid=aIngEEcxyyq0IZa7ABdN"
is the initiation of a socket.io/webSocket connection. They all start with an http request which is then "upgraded" to the webSocket protocol. The connection stays open until the web browser closes that page or until the client code closes the connection.
These requests are not pings. Pings happen internal to the webSocket connection and are not logged at the http request level (socket.io pings are visible in the network tab of the Chrome debugger).
Upvotes: 1
Reputation: 14583
Never used socket.io but I expect service time to be the time it took to serve the request. Since you're serving a WebSockets API, which essentially means keeping the tunnel open until either the client or the server closes them, it's perfectly normal for the request to take a long time.
Upvotes: 1