Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You mean you didn't *know* she was off making lots of little phone companies?


devel / comp.lang.python / Re: Simple TCP proxy

SubjectAuthor
o Re: Simple TCP proxyChris Angelico

1
Re: Simple TCP proxy

<mailman.119.1659001396.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23419&group=comp.lang.python#23419

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: rosuav@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Simple TCP proxy
Date: Thu, 28 Jul 2022 19:43:02 +1000
Lines: 18
Message-ID: <mailman.119.1659001396.20444.python-list@python.org>
References: <CAEtLV=qB++RaC4V3KY=fjU+ZFFiPVDiMu54vtU3ThpshE46mSw@mail.gmail.com>
<CAPTjJmp12e9dN8PszftJfKS1Tsx0oNFzN=b2geTXg6fRPAs3Mg@mail.gmail.com>
<CAEtLV=puoKj255t813NAODH4680bwwySah8gOi8DiGkxHrkrXA@mail.gmail.com>
<20220727205810.55ivclftzsggrenx@gmail.com>
<CAEtLV=oYQvFpapDLS+H-sw_tfwpzt-Wi_gGJc6MLyLVRG_WgEg@mail.gmail.com>
<CAPTjJmoMzw26QFPSYRh8cxZ03V0Pcz3nJcMhfq+otOjEYqRJBQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de +oTrGpaoQC2zTpB1go4IMw5qDSjOjXqncMqB3yJ8cZ2Q==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=ZXcngdnR;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'jul': 0.04; '2022': 0.05; 'cpu': 0.07; 'threads': 0.09;
'url:commit': 0.09; 'url:github': 0.14; 'that.': 0.15; 'url-
ip:140/8': 0.15; 'chrisa': 0.16; 'consume': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'received:209.85.218': 0.16; 'sockets': 0.16; 'something?': 0.16;
'wrote:': 0.16; 'instead': 0.17; 'thu,': 0.19; 'to:addr:python-
list': 0.20; 'thinking': 0.28; 'message-id:@mail.gmail.com': 0.32;
'but': 0.32; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'using': 0.37; "it's": 0.37;
'received:209.85': 0.37; 'received:209': 0.39; 'handle': 0.39;
'block': 0.39; 'something': 0.40; 'simply': 0.63; 'waiting': 0.73;
'little': 0.73; 'hundreds': 0.75; 'martin.': 0.84; 'measurable':
0.84; 'usage.': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=JGQS9kY1O8o6c871k1tYRtvXsuukNtPd4u8KBlxTehA=;
b=ZXcngdnRwzKEWNp7K3H4se9lzN/29Vx3cNoMfRAGXac2pPQp2RC+2Swwlz2R762iOJ
xBBkg2WWHHwPoW+VSI0EO3r5sNCNm9OeSjFAvW5fTeS0pmhW6X869j9asgwz7nJCz7l7
Xi2X9XuqGV/yqXasD3Uwjo4mDs/cNFsgLpG1t73BbowdweNUIFscAAnk5RqfgvAlJKIa
7ZzRLRwpqdFKiBbIPE+G+apEkQSK070fjSGLkiZwT0uX9hP54eNOPwuihAP3361GxHq4
tS66cnTC2Pl1StspfZ+9Rp2TZegltvoRE8+LsrmhUNRKl9FK2cjmBSKSM0sU2Y8XUk6n
JyXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=JGQS9kY1O8o6c871k1tYRtvXsuukNtPd4u8KBlxTehA=;
b=GFpJZ0/tlriQEZOMpFJ3meFPoaIcGMd2S/YlSojmyYQrSYHUbTkaM1AMx3zYWfEFPP
M94xntcVCunviczpldqxOkVkh/0JBJr1gkCTtTEhgn++wj+3mIUAwKgSpcIvc2/MohJ4
7odKKclaaBCxp/cTIARremLo20XHVx/CZssZvAd7r0pV2lXosrVvU/pXzE/iOruS1wQv
Zxj8O8AVIhvrXcp6tF+xAO7KFuNSDBF2erJi8CnwU/j32L/yoGBMi677z087+otXPhvW
TUh+46TAVmLI1pVS8EAEgVtNzCwtgMjnZq/wZFU/u2nhPd5Lxoq74jhmIJ9WXgF+irTz
LXOw==
X-Gm-Message-State: AJIora8BmGPOV/L0oUeIwGb9vJ0FvXzTR8wrJTCIeU6NhFXHeY7r4J3a
/lhVyRINyyoP5u8nJEQfmCKNiIWNhcRcT7HkjVfko2LU
X-Google-Smtp-Source: AGRyM1uiBVPPzmkcid7PrzsmHiAwyHBm3CFZJrfDNPbjf1F0dDR68sXxIZ9PkMRmTeofWoN0l0bM5my2cinXlsF3Sbo=
X-Received: by 2002:a17:907:628c:b0:6ee:70cf:d59 with SMTP id
nd12-20020a170907628c00b006ee70cf0d59mr20213528ejc.402.1659001393959; Thu, 28
Jul 2022 02:43:13 -0700 (PDT)
In-Reply-To: <CAEtLV=oYQvFpapDLS+H-sw_tfwpzt-Wi_gGJc6MLyLVRG_WgEg@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmoMzw26QFPSYRh8cxZ03V0Pcz3nJcMhfq+otOjEYqRJBQ@mail.gmail.com>
X-Mailman-Original-References: <CAEtLV=qB++RaC4V3KY=fjU+ZFFiPVDiMu54vtU3ThpshE46mSw@mail.gmail.com>
<CAPTjJmp12e9dN8PszftJfKS1Tsx0oNFzN=b2geTXg6fRPAs3Mg@mail.gmail.com>
<CAEtLV=puoKj255t813NAODH4680bwwySah8gOi8DiGkxHrkrXA@mail.gmail.com>
<20220727205810.55ivclftzsggrenx@gmail.com>
<CAEtLV=oYQvFpapDLS+H-sw_tfwpzt-Wi_gGJc6MLyLVRG_WgEg@mail.gmail.com>
 by: Chris Angelico - Thu, 28 Jul 2022 09:43 UTC

On Thu, 28 Jul 2022 at 19:41, Morten W. Petersen <morphex@gmail.com> wrote:
>
> Hi Martin.
>
> I was thinking of doing something with the handle function, but just this
> little tweak:
>
> https://github.com/morphex/stp/commit/9910ca8c80e9d150222b680a4967e53f0457b465
>
> made a huge difference in CPU usage. Hundreds of waiting sockets are now
> using 20-30% of CPU instead of 10x that.

..... wait, what?

Why do waiting sockets consume *any* measurable amount of CPU? Why
don't the threads simply block until it's time to do something?

ChrisA


devel / comp.lang.python / Re: Simple TCP proxy

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor