From: Daniel Kiper <dkiper@net-space.pl>
To: arvidjaar@gmail.com, hufman@gmail.com, grub-devel@gnu.org
Subject: Re: Patch: Improve HTTP time by sending Connection:close
Date: Tue, 15 Nov 2016 21:44:51 +0100 [thread overview]
Message-ID: <20161115204451.GF16470@router-fw-old.local.net-space.pl> (raw)
In-Reply-To: <CAA91j0Xq+wzOM=Y=eESTbEnSDNujoy9oNw-nbTkDVmw8VXM8LQ@mail.gmail.com>
On Tue, Nov 15, 2016 at 05:30:28PM +0300, Andrei Borzenkov wrote:
> On Tue, Nov 15, 2016 at 4:21 PM, Daniel Kiper <dkiper@net-space.pl> wrote:
> > On Sat, Nov 12, 2016 at 09:26:17AM -0800, Walter Huf wrote:
> >> GRUB's HTTP module declares support for HTTP/1.1, which defaults to
> >> Connection:keepalive. At the end of the content, the server holds the TCP
> >> connection open waiting for the next request.
> >> It seems that grub_net_poll_cards() is watching for the HTTP module to set
> >
> > Do you have a feeling or are you sure? I think that we have to be sure here.
> >
>
> See http://savannah.gnu.org/bugs/?49531 which has more details.
OK but I think that this should be a part of commit meesage.
> >> net->stall, and otherwise waits the full 400ms GRUB_NET_INTERVAL to return
> >> to processing. However, HTTP module only sets that flag in specific
> >> conditions:
> >>
> >> - parse_line detects that we are at the end of downloading a chunked
> >> Transfer-Encoding
> >> - http_err detects a problem with the underlying TCP connection
> >> - http_receive has queued 20 netbuffer packets for processing
> >>
> >> If the file is small and takes less than 20 packets, and the server is not
> >> using chunked encoding, grub_net_poll_cards() will wait the full 400ms
> >> before continuing to process and finish the file download.
> >>
> >> This patch sets Connection:close, which will tell the server to close the
> >> connection as soon as it has finished sending the file. GRUB closes any
> >> connections that are left open (in http_seek), so it does not change
> >
> > Why in http_seek? Is it correct or not?
> >
> >> performance. When the server disconnects, I think it triggers http_err and
> >
> > "I think" is too soft. You have to be sure here.
> >
> >> then quits out of grub_net_poll_cards early.
> >
> > Lack of SOB.
> >
>
> I must have missed it. Is it now required?
No (probably it should be sooner or later but we have to discuss this
issue separetly), however, nice to have.
> > Have you tested this patch with large/huge number of files to transfer? I have
> > a feeling that it can slowdown whole transfer in such cases due to number of
> > connects/disconnects. Maybe this feature should be conditional thing.
> >
>
> Currently grub will always establish new connection in http_open ->
> http_establish, so it should not change anything from grub PoV, but
> reduce amount of lingering connections on server. But I would really
> like to explore another patch in above bug report - gracefully close
> connection when we finished receive data. That said, this one does not
Looking (shortly) at problem description I am not sure that it will fix
the issue. Though I am not convinced that we should play with keep alive
too. Hence, better/nicer solution is appreciated.
Daniel
next prev parent reply other threads:[~2016-11-15 20:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-12 17:26 Patch: Improve HTTP time by sending Connection:close Walter Huf
2016-11-15 13:21 ` Daniel Kiper
2016-11-15 14:30 ` Andrei Borzenkov
2016-11-15 20:44 ` Daniel Kiper [this message]
2016-11-15 21:43 ` Walter Huf
2016-11-16 3:20 ` Andrei Borzenkov
2016-11-17 18:32 ` Daniel Kiper
2016-11-17 18:41 ` Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161115204451.GF16470@router-fw-old.local.net-space.pl \
--to=dkiper@net-space.pl \
--cc=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=hufman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).