Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #108668

Re: OT: limit number of connections from browser to my server?

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: OT: limit number of connections from browser to my server?
Date 2016-05-17 02:15 +1000
Message-ID <mailman.18.1463415352.19823.python-list@python.org> (permalink)
References <nhcr5g$o1k$1@ger.gmane.org> <CAPTjJmrTf5iCe8sN8WrouhBV867UZF4DgFOC9OFkhHSxZoajNw@mail.gmail.com>

Show all headers | View raw


On Tue, May 17, 2016 at 2:06 AM, Grant Edwards
<grant.b.edwards@gmail.com> wrote:
> So, when a browser wants to load a page that has the main html file, a
> css file, a javascript library or two, and a few icons and background
> bitmaps, they browser opens up a half-dozen SSL connections in
> parallel.
>
> That's fine when the server is Facebook's server farm.
>
> But when it's a small embedded device running at 40MHz with a
> single-threaded web server and software crypto, it turns a 2-second
> page load time into a 15-second page load time.
> ...
> So now I'm going to set up a simple Python HTTP server to try some
> other approaches:
>
>   1) Only allow the listening socket to accept 1 connection at a time.
>
>   2) Accept the TCP connection, but don't allow the SSL handshaking to
>      start on the "extra" connections.
>
>   3) ???
>
>   4) Profits!
>
> Any ideas?

If your server is single-threaded, it ought to be processing only one
connection at a time anyway. Are you sure parallel connections are the
problem here?

The solution might actually be to move all your static files
elsewhere. Slap 'em up onto github.io or something, and then the
browser is free to make all the parallel connections it likes; your
embedded device can just serve the stuff that actually varies
(presumably the main HTML file). I know that isn't what you asked for,
but it's something to consider :)

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: OT: limit number of connections from browser to my server? Chris Angelico <rosuav@gmail.com> - 2016-05-17 02:15 +1000
  Re: OT: limit number of connections from browser to my server? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-05-16 16:34 +0000
    Re: OT: limit number of connections from browser to my server? Chris Angelico <rosuav@gmail.com> - 2016-05-17 02:52 +1000
      Re: OT: limit number of connections from browser to my server? Steven D'Aprano <steve@pearwood.info> - 2016-05-17 12:50 +1000
        Re: OT: limit number of connections from browser to my server? Chris Angelico <rosuav@gmail.com> - 2016-05-17 13:02 +1000
          Re: OT: limit number of connections from browser to my server? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-05-17 15:22 +1000
        Re: OT: limit number of connections from browser to my server? Gene Heskett <gheskett@wdtv.com> - 2016-05-17 01:26 -0400
        Re: OT: limit number of connections from browser to my server? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-05-17 16:59 +0000
          Re: OT: limit number of connections from browser to my server? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-17 18:42 +0000
            Re: OT: limit number of connections from browser to my server? Paul Rubin <no.email@nospam.invalid> - 2016-05-29 22:03 -0700
              Re: OT: limit number of connections from browser to my server? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-31 15:31 +0000
          Re: OT: limit number of connections from browser to my server? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-05-17 18:28 -0400
          Re: OT: limit number of connections from browser to my server? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-18 13:58 +0000
    Re: OT: limit number of connections from browser to my server? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-16 19:19 +0000
      Re: OT: limit number of connections from browser to my server? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-05-16 20:09 +0000
      Re: OT: limit number of connections from browser to my server? Paul Rubin <no.email@nospam.invalid> - 2016-05-16 13:41 -0700
        Re: OT: limit number of connections from browser to my server? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-16 21:32 +0000
          Re: OT: limit number of connections from browser to my server? Paul Rubin <no.email@nospam.invalid> - 2016-05-29 22:00 -0700

csiph-web