buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.42k stars 4 forks source link

The transfer fails for POST requests that exceed a certain size. #1201

Closed ohs30359-nobuhara closed 10 months ago

ohs30359-nobuhara commented 1 year ago

I am trying to use goreplay to transfer JSON payloads to an application via POST. This application is running on Kubernetes, where the main container's traffic is being intercepted by a sidecar running goreplay and then forwarded to another pod.

However, I am encountering errors during the transfer of POSTed JSON payloads in this application, and this issue seems to occur even for small payload sizes of around 2KB. The FAQ mentions the possibility of packet loss for larger payloads exceeding 200KB, but I don't think this issue should be applicable to a JSON payload of this size.

FAQ · buger/goreplay Wiki · GitHub

Due to the fact that Gor can't guarantee interception of all packets, for large payloads > 200kb there is chance of missing some packets and corrupting body. Treat it as a feature and chance to test broken bodies handling :) The only way to guarantee delivery is using --input-http, but you will miss some features

I apologize for the inconvenience. Could you please provide me with your insights on this issue?

Execution Environment:

Docker (golang:1.17-alpine) goreplay Version 1.3.0 Command: gor --input-raw :80 --output-http http://receiver.xxxxx --input-raw-buffer-size 1048576

qiyon commented 10 months ago

I encountered the same issue, and need to use with input-raw-override-snaplen option, for example:

gor --input-raw :80 --output-http http://receiver.xxxxx/ --input-raw-buffer-size 1048576 --input-raw-override-snaplen
ohs30359-nobuhara commented 10 months ago

thank you. I solved it with what you suggested! Thank you for your help!