goreplay icon indicating copy to clipboard operation
goreplay copied to clipboard

--input-raw-track-response not always track the reponse

Open renhongchao opened this issue 7 years ago β€’ 8 comments

Version: 1.0.0 Debian GNU/Linux 8

--output-stdout info

Version: 1.0.0 1 2222dd26fb8020eb5c822aec11b58d33439dc62e 1555293839184795642 GET /data/video/recommendData/query?size=1 HTTP/1.1 User-Agent: curl/7.38.0 Host: XXXX:8090 Accept: /

1 f016761de473c3dfca9292f3614a48dccf78722e 1555293842850929583 GET /health/status HTTP/1.1 User-Agent: curl/7.38.0 Host: XXXX:8090 Accept: /

2 f016761de473c3dfca9292f3614a48dccf78722e 1555293842851786055 856472 HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/javascript;charset=utf-8 Content-Length: 5 Date: Mon, 15 Apr 2019 02:04:02 GMT

alive

the first request cannot track the reponse but the second one show the reponse why is that

renhongchao avatar Apr 15 '19 02:04 renhongchao

I have the same issue. Some responses get recorded and others don't. I waited long enough so that gor should've written all responses.

./bin/gor --input-raw :80 --input-raw-track-response --output-http-track-response --prettify-http --output-file recording.log

Sample single call with no response:

1 3f04ca1781cf06b82f6f06dd556ed7a05a8ecc8a 1566214890637216518
GET /xyz.do HTTP/1.1
Host: xxx
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: abc=def
Upgrade-Insecure-Requests: 1
DNT: 1


πŸ΅πŸ™ˆπŸ™‰

Does this have to do with keep-alive or chunked transfer encoding?

black-snow avatar Aug 19 '19 11:08 black-snow

Same when I use curl without chunked or keep-alive:

1 0bc8e1df227c5f019e8368c3c7ab7eb18df01d01 1566216163104723840
GET /xyz.do HTTP/1.1
Host: xxx
User-Agent: curl/7.65.3
Accept: */*


πŸ΅πŸ™ˆπŸ™‰

black-snow avatar Aug 19 '19 12:08 black-snow

try this β€”input-raw-buffer-size xxMB

Added β€”input-raw-buffer-size which controls size of the OS buffer (in bytes) which holds packets until they dispatched. Default value depends by system: in Linux around 2MB. If you see big package drop, increase this value.

wu0407 avatar Aug 22 '19 05:08 wu0407

@wu0407 thanks for the hint. I set it to 10MB but still no responses for these requests :|

black-snow avatar Aug 26 '19 16:08 black-snow

Same here.. tried:

  • --input-raw-buffer-size with 10MB
  • --copy-buffer-size 10MB
  • --input-raw-expire 10s

Going by this https://github.com/buger/goreplay/wiki/Dealing-with-missing-requests-and-responses , it seems the last option is to play around with snaplen in kernel itself, which is something I cannot afford doing in our current environment.

premkumar-gg avatar Sep 11 '19 16:09 premkumar-gg

Here is the command I tried:

./gor --input-raw :80 --input-raw-track-response --output-file requests.gor --input-raw-buffer-size 10485760 --input-raw-expire 10s --copy-buffer-size 1280880

Here is the output:

1 45b8d38b717b2040c0b5d11e1d82bee0ee72f69b 1568219458922730460
GET /activate HTTP/1.1^M
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2^M
Host: localhost^M
Accept: */*^M
^M

πŸ΅πŸ™ˆπŸ™‰

premkumar-gg avatar Sep 11 '19 16:09 premkumar-gg

Hi! If you can record raw tcpdump recording of this traffic it will help.

ср, 11 сСнт. 2019 Π³. Π² 19:35, Premkumar Anand [email protected]:

Here is the command I tried:

./gor --input-raw :80 --input-raw-track-response --output-file requests.gor --input-raw-buffer-size 10485760 --input-raw-expire 10s --copy-buffer-size 1280880

Here is the output:

1 45b8d38b717b2040c0b5d11e1d82bee0ee72f69b 1568219458922730460

GET /activate HTTP/1.1^M

User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2^M

Host: localhost^M

Accept: /^M

^M

πŸ΅πŸ™ˆπŸ™‰

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/buger/goreplay/issues/666?email_source=notifications&email_token=AAADNOIH6ZZ2CI6DCROGQHLQJEM3RA5CNFSM4HF4BNOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PDGCY#issuecomment-530461451, or mute the thread https://github.com/notifications/unsubscribe-auth/AAADNOPGL46366V6J3HMS4DQJEM3RANCNFSM4HF4BNOA .

-- Sincerely yours, Leonid Bugaev https://goreplay.org - test your system with real data @buger https://twitter.com/buger - me on twitter

buger avatar Sep 12 '19 06:09 buger

Thanks @buger . I have sent an email to [email protected] with the tcpdump. Hope that helps. Let me know for any further information. The service runs on RHEL6.

premkumar-gg avatar Sep 12 '19 10:09 premkumar-gg