Closed mycxu closed 1 month ago
We support both STOMP over WebSocket(by default) and HTTP protocol for analysis requests.
You can change the protocol by modifying the following code, change byStomp
to byAxios
The main reason for using Stomp over WebSocket is that time-consuming analysis requests will cause timeout, and this problem cannot be fully fixed by updating the timeout config of server/client.
Did you encounter any problems?
We support both STOMP over WebSocket(by default) and HTTP protocol for analysis requests.
You can change the protocol by modifying the following code, change
byStomp
tobyAxios
The main reason for using Stomp over WebSocket is that time-consuming analysis requests will cause timeout, and this problem cannot be fully fixed by updating the timeout config of server/client.
I haven't fully understood why using HTTP would lead to request timeouts. The parsing of the heap dump file is performed asynchronously and should not cause the request to block. However, when the parsing is complete, there is a significant blocking period when I call interfaces for ’泄漏检测‘. Is this where HTTP requests might lead to timeouts?
when the parsing is complete, there is a significant blocking period when I call interfaces for ’泄漏检测‘. Is this where HTTP requests might lead to timeouts?
Yes, it's one of the cases.
Indeed, the parsing process of the heap dump is async, but some analysis requests still need some time to process, e.g. sort the list, complex OQL...
The processing time relates to the heap dump size, object graph complexity, and host resource...
Generally, the response time for analysis requests cannot be guaranteed. If a request takes a long time to be processed, the HTTP connection may be closed by the internal network devices, that is why I said the timeout problem cannot be fully fixed by updating the timeout config of server/client
.
By WebSocket, we can keep the connection live by heartbeat detection.
There is no difference between using Stomp and HTTP for end users.
when the parsing is complete, there is a significant blocking period when I call interfaces for ’泄漏检测‘. Is this where HTTP requests might lead to timeouts?
Yes, it's one of the cases.
Indeed, the parsing process of the heap dump is async, but some analysis requests still need some time to process, e.g. sort the list, complex OQL...
The processing time relates to the heap dump size, object graph complexity, and host resource...
Generally, the response time for analysis requests cannot be guaranteed. If a request takes a long time to be processed, the HTTP connection may be closed by the internal network devices, that is why I said
the timeout problem cannot be fully fixed by updating the timeout config of server/client
.By WebSocket, we can keep the connection live by heartbeat detection.
I think I now understand why WebSocket is needed. Thank you for your explanation.
I noticed that jifa parses various types of files through WebSocket communications, but they all operate in a request-response mode. Is the reason for this because using WebSocket can save more resources by avoiding the need to carry a large amount of header information with each request, as compared to HTTP requests, or are there other reasons?