{"thread":{"id":"41459","subject":"Please document git-http-backend/Apache timeout interactions","startedAt":"2016-02-21T22:17:44Z","lastAt":"2016-02-21T23:34:27Z","messageCount":3,"participants":["Steinar H. Gunderson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"278783","messageId":"20160221221744.GA38068@sesse.net","threadId":"41459","inReplyTo":null,"subject":"Please document git-http-backend/Apache timeout interactions","fromName":"Steinar H. Gunderson","fromEmail":"sgunderson@bigfoot.com","sentAt":"2016-02-21T22:17:44Z","receivedAt":"2016-02-21T22:17:44Z","isPatch":false,"sender":{"key":"sgunderson@bigfoot.com","avatar":null},"body":"Hi,\n\nI am running git-http-backend behind Apache as suggested in\ngit-http-backend(1). However, what it fails to mention is that\ngit-fetch-pack seemingly can be very slow in sending its request.\nConsequently, mod_reqtimeout (on by default, as I understand it)\nkicks in as an anti-DoS measure, and the user sees a 408 (timeout)\nerror.\n\nSeemingly the simplest fix is to turn off mod_reqtimeout in the vhost\nserving git (potentially with some <IfModule> around it):\n\n   RequestReadTimeout header=0 body=0\n\nWould you consider adding this to the documentation?\n\nThanks!\n\n/* Steinar */\n-- \nHomepage: https://www.sesse.net/\n"},{"id":"278794","messageId":"xmqqwppx8wwb.fsf@gitster.mtv.corp.google.com","threadId":"41459","inReplyTo":"20160221221744.GA38068@sesse.net","subject":"Re: Please document git-http-backend/Apache timeout interactions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-21T23:29:56Z","receivedAt":"2016-02-21T23:29:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Steinar H. Gunderson\" <sgunderson@bigfoot.com> writes:\n\n> I am running git-http-backend behind Apache as suggested in\n> git-http-backend(1). However, what it fails to mention is that\n> git-fetch-pack seemingly can be very slow in sending its request.\n> Consequently, mod_reqtimeout (on by default, as I understand it)\n> kicks in as an anti-DoS measure, and the user sees a 408 (timeout)\n> error.\n>\n> Seemingly the simplest fix is to turn off mod_reqtimeout in the vhost\n> serving git (potentially with some <IfModule> around it):\n>\n>    RequestReadTimeout header=0 body=0\n>\n> Would you consider adding this to the documentation?\n\nThis feels 70% like \"how to configure your Apache server when you\nrun site that is contacted by a client that is slow to talk?\", that\nis not necessarily specific to Git.\n\nAlso while it may make sense to tweak the timeout on the server\nside, recommending to disable it altogether, instead of adjusting to\nthe typical requirement for a sane client, feels just wrong.\n\nAlso, are all requests from one client slow to start, or are only\nsome phases in the protocol exchange slow but not others?  If the\nserver side can tell which ones could be normally slow, selectively\nloosening timeouts only for them might be more palatable, but I am\nsensing that you are not suggesting such an approach.\n\nFor these reasons, I am on the fence.\n"},{"id":"278798","messageId":"20160221233427.GA13598@sesse.net","threadId":"41459","inReplyTo":"xmqqwppx8wwb.fsf@gitster.mtv.corp.google.com","subject":"Re: Please document git-http-backend/Apache timeout interactions","fromName":"Steinar H. Gunderson","fromEmail":"sgunderson@bigfoot.com","sentAt":"2016-02-21T23:34:27Z","receivedAt":"2016-02-21T23:34:27Z","isPatch":false,"sender":{"key":"sgunderson@bigfoot.com","avatar":null},"body":"On Sun, Feb 21, 2016 at 03:29:56PM -0800, Junio C Hamano wrote:\n> This feels 70% like \"how to configure your Apache server when you\n> run site that is contacted by a client that is slow to talk?\", that\n> is not necessarily specific to Git.\n\nIt's specific to Git in the sense that Git seemingly as a normal matter of\ncourse posts very slowly to /git-upload-pack. Normal HTTP clients don't work\nthis way; they typically have their entire POST body ready before they decide\nto make a request.\n\n> Also while it may make sense to tweak the timeout on the server\n> side, recommending to disable it altogether, instead of adjusting to\n> the typical requirement for a sane client, feels just wrong.\n\nTrue, although I have no idea what the right limits would be.\n\n> Also, are all requests from one client slow to start, or are only\n> some phases in the protocol exchange slow but not others?  If the\n> server side can tell which ones could be normally slow, selectively\n> loosening timeouts only for them might be more palatable, but I am\n> sensing that you are not suggesting such an approach.\n\nI know only of /git-upload-pack having this pattern, and it is the only one I\nam seeing 408 errors for in my logs. It seems to fail very rarely (~0.2% of\nall /git-upload-pack requests), but for some users, it's seemingly very\npersistent.\n\n/* Steinar */\n-- \nHomepage: https://www.sesse.net/\n"}]}