-1

Recently for one django website I am noticing some strange log messages. Normally when I open the website in a browser I get following in log message

"GET / HTTP/1.1" 200 7031

which is returning HTTP OK response and 7031 bytes. But sometimes I see following in log messages

"GET / HTTP/1.1" 200 25803

which is not normal and looks suspicious since bytes returned are 25803. I am not sure how to check what those extra bytes are. Could anyone suggest how to debug and find when (under what input conditions) the server sends more data?

Due to some restrictions I won't be able to disclose some information about the site, but I'll try to share as much as I can. Please help.

Thank you so much.

  • What is so suspicious about this? – Ryan Babchishin Aug 16 '16 at 14:15
3

This might be considered as a comment rather than an answer, but I'm not allowed to post comments and there is a good chance the real answer resides in the options listed below.

According to your question, you wonder why the size of an HTTP request on the same object differs from a client to another.

There can be several explanation, and one way to really know is to run tcpdump on the nginx port. Here are some possibilities :

  • One client accepts compression and the other does not
  • The backend serves different content depending on user agent or location (eg : mobile version, different content based on geoip ...)
  • ...

Can you tell us more about your configuration (type of backend, and post the output of tcpdump)?

Also, the output of wget -S http://example.com can be useful.

  • 1
    +1 But for a more universal answer I would say that the server response likely differs as a result of the capabilities and/or cookies that the client discloses in its request headers. Compression support is indeed a likely suspect. – HBruijn Aug 16 '16 at 14:08
  • wget -S command resulted in 25803 bytes on my server side log. Thank you so much for the help with this. – Kevin Aug 16 '16 at 14:28
  • Could you type wget -S -q -O- --header\="Accept-Encoding: gzip" example.com to check if you get 7031 bytes? If so please mark the question as answered – bgtvfr Aug 16 '16 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.