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


Groups > comp.lang.python > #108686

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

From Grant Edwards <grant.b.edwards@gmail.com>
Newsgroups comp.lang.python
Subject Re: OT: limit number of connections from browser to my server?
Date 2016-05-16 19:19 +0000
Message-ID <mailman.29.1463426391.19823.python-list@python.org> (permalink)
References <nhcr5g$o1k$1@ger.gmane.org> <CAPTjJmrTf5iCe8sN8WrouhBV867UZF4DgFOC9OFkhHSxZoajNw@mail.gmail.com> <mailman.18.1463415352.19823.python-list@python.org> <nhcsps$94g$1@dont-email.me> <nhd6g5$je7$1@ger.gmane.org>

Show all headers | View raw


On 2016-05-16, Rob Gaddi <rgaddi@highlandtechnology.invalid> wrote:

> Grant, the bad news is that I know this because our firware guy had
> _exactly_ this problem, with exactly your scenario, about a month ago.
> http, not https, but the problem remains the same but for some heavy
> math. After a lot of door knocking, poking, prodding, and hoping, the
> conclusion he reached was that what you want can't be done,

Bummer.

> and he had to gut and redesign the web server to support parallel
> connections.

Mine does (in effect) support parallel connections.  With HTTP it all
works fine: browser opens 4-5 connections in parallel; sends requests
on all of them; responses come back on all of them.  A few of the
connections then get reused for additional requests, and so on.

> Turned a 45 second page load into south of one, but it wasn't pretty and
> chewed up a bunch of RAM.  We had 256K to play in; I'm assuming you've
> got closer to 32K.

I've actually got plenty of RAM.  I just can't afford the CPU time it
takes to do the public-key crypto stuff that happens each time an SSL
connection starts up.

I'm hoping that if I refuse additional connections (or stall them
before the SSL handshake), I can convince the browser to make use of
extant connections.

However, in my case, there are some cases where a connection can't be
re-used because the server doesn't know how big the reply is going to
be and the only way to identy "end of reply" is for the server to
close the connection.  In theory I can fix that by adding support to
the server for chunked encoding in the cases where the reply size is
unknown.  But that won't do me any good if the browser opens 4 more
connections before it's even seen the response from the first one.

-- 
Grant Edwards               grant.b.edwards        Yow! I'm having a RELIGIOUS
                                  at               EXPERIENCE ... and I don't
                              gmail.com            take any DRUGS

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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