Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Recursion is the root of computation since it trades description for time.


devel / comp.unix.programmer / Getting SOMAXCONN

SubjectAuthor
* Getting SOMAXCONNLawrence D'Oliveiro
+* Re: Getting SOMAXCONNLew Pitcher
|+* Re: Getting SOMAXCONNKenny McCormack
||+- Re: Getting SOMAXCONNLawrence D'Oliveiro
||`* Re: Getting SOMAXCONNJames K. Lowden
|| +- Re: Getting SOMAXCONNKenny McCormack
|| `* Re: Getting SOMAXCONNLawrence D'Oliveiro
||  +- Re: Getting SOMAXCONNKeith Thompson
||  `- Re: Getting SOMAXCONNJames K. Lowden
|`* Re: Getting SOMAXCONNLawrence D'Oliveiro
| +* Re: Getting SOMAXCONNLew Pitcher
| |+* Re: Getting SOMAXCONNLawrence D'Oliveiro
| ||`* Re: Getting SOMAXCONNLew Pitcher
| || `- Re: Getting SOMAXCONNLawrence D'Oliveiro
| |`- Re: Getting SOMAXCONNLew Pitcher
| +* Re: Getting SOMAXCONNScott Lurndal
| |`* Re: Getting SOMAXCONNKeith Thompson
| | `- Re: Getting SOMAXCONNLawrence D'Oliveiro
| `- Re: Getting SOMAXCONNKaz Kylheku
+* Re: Getting SOMAXCONNNicolas George
|`* Re: Getting SOMAXCONNLawrence D'Oliveiro
| `* Re: Getting SOMAXCONNNicolas George
|  `- Re: Getting SOMAXCONNLawrence D'Oliveiro
`* Re: Getting SOMAXCONNLawrence D'Oliveiro
 +- Re: Getting SOMAXCONNNicolas George
 `* Re: Getting SOMAXCONNScott Lurndal
  `* Re: Getting SOMAXCONNLew Pitcher
   +- Re: Getting SOMAXCONNNicolas George
   `- Re: Getting SOMAXCONNLawrence D'Oliveiro

Pages:12
Getting SOMAXCONN

<uqbtpc$170j7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11409&group=comp.unix.programmer#11409

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 01:54:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uqbtpc$170j7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 01:54:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1278567"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KO/8cUV5z+VZvkAPguBWc"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:uE+9u+gVqMfOrt+23lfgUHtcaNU=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 01:54 UTC

On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
not a static constant, but is a configurable kernel parameter. Here is a
simple Python command to return the value for your currently-running
kernel:

print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))

Re: Getting SOMAXCONN

<uqd7oa$1hn3i$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11410&group=comp.unix.programmer#11410

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 13:51:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <uqd7oa$1hn3i$1@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 13:51:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7ae9e3685e9934feaef712b4c4b2f527";
logging-data="1629298"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8LUGn2xf1KwDjea57p9ze337dvv4kUYw="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:poDhTBn59w+zwTmQgPkWAkspzw8=
 by: Lew Pitcher - Mon, 12 Feb 2024 13:51 UTC

On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:

> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
> not a static constant, but is a configurable kernel parameter. Here is a
> simple Python command to return the value for your currently-running
> kernel:
>
> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))

Here's the (ba)sh equivalent command:

cat /proc/sys/net/core/somaxconn

--
Lew Pitcher
"In Skills We Trust"

Re: Getting SOMAXCONN

<uqdd00$17sec$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11411&group=comp.unix.programmer#11411

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 15:20:32 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uqdd00$17sec$1@news.xmission.com>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
Injection-Date: Mon, 12 Feb 2024 15:20:32 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1307084"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Mon, 12 Feb 2024 15:20 UTC

In article <uqd7oa$1hn3i$1@dont-email.me>,
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>
>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
>> not a static constant, but is a configurable kernel parameter. Here is a
>> simple Python command to return the value for your currently-running
>> kernel:
>>
>> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))
>
>Here's the (ba)sh equivalent command:
>
> cat /proc/sys/net/core/somaxconn

I expect someone will post the COBOL version any minute now.

--
Those on the right constantly remind us that America is not a
democracy; now they claim that Obama is a threat to democracy.

Re: Getting SOMAXCONN

<65ca4988$0$3003$426a34cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11412&group=comp.unix.programmer#11412

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed3-b.proxad.net!nnrp4-2.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$...@salle-s.org (Nicolas George)
Subject: Re: Getting SOMAXCONN
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <uqbtpc$170j7$1@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 12 Feb 2024 16:38:32 GMT
Lines: 10
Message-ID: <65ca4988$0$3003$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 12 Feb 2024 17:38:32 CET
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1707755912 news-4.free.fr 3003 129.199.129.80:37226
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Mon, 12 Feb 2024 16:38 UTC

Lawrence D'Oliveiro , dans le message <uqbtpc$170j7$1@dont-email.me>, a
écrit :
> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket) is
> not a static constant, but is a configurable kernel parameter. Here is a
> simple Python command to return the value for your currently-running
> kernel:
>
> print(int(open("/proc/sys/net/core/somaxconn", "rt").read().strip()))

Why do you think you need it in a program?

Re: Getting SOMAXCONN

<uqe01h$1mqnb$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11413&group=comp.unix.programmer#11413

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 20:45:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uqe01h$1mqnb$3@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me>
<65ca4988$0$3003$426a34cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 20:45:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1796843"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186jtM4NzRbrPfolMyXQedd"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:V0n90eeMRsOeGzZii4zQEao4AVM=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 20:45 UTC

On 12 Feb 2024 16:38:32 GMT, Nicolas George wrote:

> Why do you think you need it in a program?

That is normally where SOMAXCONN is needed.

Re: Getting SOMAXCONN

<uqe02c$1mqnb$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11414&group=comp.unix.programmer#11414

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!nyheter.lysator.liu.se!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 20:46:04 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uqe02c$1mqnb$4@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 20:46:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1796843"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZtPQc+qGwJrpMGnJifRVU"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:bDp8Juhuy/ICeKNG7hF1CuuR1tw=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 20:46 UTC

On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:

> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>
>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>> is not a static constant, but is a configurable kernel parameter. Here
>> is a simple Python command to return the value for your
>> currently-running kernel:
>>
>> print(int(open("/proc/sys/net/core/somaxconn",
>> "rt").read().strip()))
>
> Here's the (ba)sh equivalent command:
>
> cat /proc/sys/net/core/somaxconn

Code normally needs it as an integer.

Re: Getting SOMAXCONN

<uqe0qc$1mdue$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11415&group=comp.unix.programmer#11415

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 20:58:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uqe0qc$1mdue$1@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 20:58:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7ae9e3685e9934feaef712b4c4b2f527";
logging-data="1783758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AFVkTKx7PaASKvCFzdMsBxu52JkmwpOc="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:T8dsOpvlY6vZFCKOwJ6y8bBuIjk=
 by: Lew Pitcher - Mon, 12 Feb 2024 20:58 UTC

On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:

> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
> Code normally needs it as an integer.

If you say so...

$(($(cat /proc/sys/net/core/somaxconn) + 1))

I added 1 to somaxconn. It's math, so I must have an integer.

--
Lew Pitcher
"In Skills We Trust"

Re: Getting SOMAXCONN

<IEvyN.142336$taff.26273@fx41.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11416&group=comp.unix.programmer#11416

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Getting SOMAXCONN
Newsgroups: comp.unix.programmer
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me> <uqe02c$1mqnb$4@dont-email.me>
Lines: 21
Message-ID: <IEvyN.142336$taff.26273@fx41.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 12 Feb 2024 20:59:20 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 12 Feb 2024 20:59:20 GMT
X-Received-Bytes: 1423
 by: Scott Lurndal - Mon, 12 Feb 2024 20:59 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
>Code normally needs it as an integer.

$ application -m $(cat /proc/sys/net/core/somaxconn)

Re: Getting SOMAXCONN

<uqe1b8$1n31c$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11417&group=comp.unix.programmer#11417

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:07:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uqe1b8$1n31c$1@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqdd00$17sec$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 21:07:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1805356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xQvx3sgCLV5unvdWRyRwo"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:7lC92meMXSl8bd/fFSnDbALnTD4=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 21:07 UTC

On Mon, 12 Feb 2024 15:20:32 -0000 (UTC), Kenny McCormack wrote:

> I expect someone will post the COBOL version any minute now.

.... on BSD.

Re: Getting SOMAXCONN

<uqe1c9$1n31c$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11418&group=comp.unix.programmer#11418

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:08:26 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uqe1c9$1n31c$2@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <uqe0qc$1mdue$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 21:08:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1805356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J8t9b6pTENHrLfkyfLS4f"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:pceZ4Yr9/deYRc4D63UaBm6KAlM=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 21:08 UTC

On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote:

> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>
>> Code normally needs it as an integer.
>
> If you say so...
>
> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>
> I added 1 to somaxconn. It's math, so I must have an integer.

Now use it as one.

Re: Getting SOMAXCONN

<uqe1cl$1mdue$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11419&group=comp.unix.programmer#11419

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:08:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <uqe1cl$1mdue$2@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <uqe0qc$1mdue$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 21:08:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7ae9e3685e9934feaef712b4c4b2f527";
logging-data="1783758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Z7N8z2EpJKuhDW/Ci6QAGM3sD1lRkx90="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:hAlY8jT6Aqrd87gtmWpsKF2d4F4=
 by: Lew Pitcher - Mon, 12 Feb 2024 21:08 UTC

On Mon, 12 Feb 2024 20:58:53 +0000, Lew Pitcher wrote:

> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>
>> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>>
>>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>>
>>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>>> is not a static constant, but is a configurable kernel parameter. Here
>>>> is a simple Python command to return the value for your
>>>> currently-running kernel:
>>>>
>>>> print(int(open("/proc/sys/net/core/somaxconn",
>>>> "rt").read().strip()))
>>>
>>> Here's the (ba)sh equivalent command:
>>>
>>> cat /proc/sys/net/core/somaxconn
>>
>> Code normally needs it as an integer.
>
> If you say so...
>
> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>
> I added 1 to somaxconn. It's math, so I must have an integer.

Here's the thing. Without context, neither Lawrence's solution
nor mine are worth anything.

We note that, in Linux, SOMAXCONN is variable, and we can read
a string equivalent of it's value from file /proc/sys/net/core/somaxconn

Someone posts a "simple python command" to do so, and someone else posts
a bash/sh command to do the same.

But, the OP's unstated context was that the integer value of SOMAXCONN
might be needed in a program /as an integer value/ (and not a string).
The posted code was seemingly intended to show an example of a program
that derived the integer value of SOMAXCONN from the string stored in
the /proc/sys/net/core/somaxconn file.

And the counter-example showed the same thing.

But, in the end, neither example is relevant. For example, neither
example code fragment will be of use in a C (or COBOL) program.

And, so ends my facetious banter about SOMAXCONN. You may now
resume your regularly scheduled programming.
--
Lew Pitcher
"In Skills We Trust"

Re: Getting SOMAXCONN

<uqe1eb$1mdue$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11420&group=comp.unix.programmer#11420

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:09:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uqe1eb$1mdue$3@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <uqe0qc$1mdue$1@dont-email.me>
<uqe1c9$1n31c$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 21:09:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7ae9e3685e9934feaef712b4c4b2f527";
logging-data="1783758"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jNKc1uH6qOHFC+xm9qNIGNOILKyoV4Ew="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:4YIx5q7DhTMxps6N1xQ1sgBQhvs=
 by: Lew Pitcher - Mon, 12 Feb 2024 21:09 UTC

On Mon, 12 Feb 2024 21:08:26 +0000, Lawrence D'Oliveiro wrote:

> On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>>
>>> Code normally needs it as an integer.
>>
>> If you say so...
>>
>> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>>
>> I added 1 to somaxconn. It's math, so I must have an integer.
>
> Now use it as one.

OK
echo SOMAXCONN plus 1 equals $(($(cat /proc/sys/net/core/somaxconn) + 1))

--
Lew Pitcher
"In Skills We Trust"

Re: Getting SOMAXCONN

<uqe1ro$1n31c$6@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11421&group=comp.unix.programmer#11421

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:16:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <uqe1ro$1n31c$6@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <uqe0qc$1mdue$1@dont-email.me>
<uqe1c9$1n31c$2@dont-email.me> <uqe1eb$1mdue$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 21:16:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1805356"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qhozfO0M0YMqPO86t2Ux+"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:8hgajrOmBHRC9ecy0vJMshI5GfE=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 21:16 UTC

On Mon, 12 Feb 2024 21:09:31 -0000 (UTC), Lew Pitcher wrote:

> On Mon, 12 Feb 2024 21:08:26 +0000, Lawrence D'Oliveiro wrote:
>
>> On Mon, 12 Feb 2024 20:58:53 -0000 (UTC), Lew Pitcher wrote:
>>
>>> On Mon, 12 Feb 2024 20:46:04 +0000, Lawrence D'Oliveiro wrote:
>>>
>>>> Code normally needs it as an integer.
>>>
>>> If you say so...
>>>
>>> $(($(cat /proc/sys/net/core/somaxconn) + 1))
>>>
>>> I added 1 to somaxconn. It's math, so I must have an integer.
>>
>> Now use it as one.
>
> OK
> echo SOMAXCONN plus 1 equals $(($(cat /proc/sys/net/core/somaxconn) +
> 1))

As in:

SOMAXCONN = None # to begin with

def get_SOMAXCONN() :
"returns the Linux kernel-configured value of SOMAXCONN."
global SOMAXCONN
if SOMAXCONN == None :
SOMAXCONN = int(open("/proc/sys/net/core/somaxconn", "rt").read().strip())
#end if
return \
SOMAXCONN
#end get_SOMAXCONN

sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.listen(get_SOMAXCONN())

Re: Getting SOMAXCONN

<87jzn98i71.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11422&group=comp.unix.programmer#11422

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 13:51:30 -0800
Organization: None to speak of
Lines: 10
Message-ID: <87jzn98i71.fsf@nosuchdomain.example.com>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <IEvyN.142336$taff.26273@fx41.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="dde32586fdbd978f355be701e1d622ad";
logging-data="1818910"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/J4sDhAtJnEKcrD7P4EXXo"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:JBiJy6lD7g9EOOV6CRcyHBSMhY0=
sha1:JyAjbvfdUX0gmctXAOh59uh+KSM=
 by: Keith Thompson - Mon, 12 Feb 2024 21:51 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
[...]
> $ application -m $(cat /proc/sys/net/core/somaxconn)

$ application -m $(</proc/sys/net/core/somaxconn)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: Getting SOMAXCONN

<20240212135111.403@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11423&group=comp.unix.programmer#11423

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 433-929-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 21:53:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20240212135111.403@kylheku.com>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me>
Injection-Date: Mon, 12 Feb 2024 21:53:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0489c1ee0a9a9323b69203c51b6d613e";
logging-data="1819760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/k2jElM8LNRMs6mg86JrXcXCl5UeLIOfA="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:kI0TgZKAVpSBzPaXWGNYvzSKaZM=
 by: Kaz Kylheku - Mon, 12 Feb 2024 21:53 UTC

On 2024-02-12, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> On Mon, 12 Feb 2024 13:51:06 -0000 (UTC), Lew Pitcher wrote:
>
>> On Mon, 12 Feb 2024 01:54:52 +0000, Lawrence D'Oliveiro wrote:
>>
>>> On Linux, SOMAXCONN (the maximum size of the listen queue for a socket)
>>> is not a static constant, but is a configurable kernel parameter. Here
>>> is a simple Python command to return the value for your
>>> currently-running kernel:
>>>
>>> print(int(open("/proc/sys/net/core/somaxconn",
>>> "rt").read().strip()))
>>
>> Here's the (ba)sh equivalent command:
>>
>> cat /proc/sys/net/core/somaxconn
>
> Code normally needs it as an integer.

This is the TXR Lisp interactive listener of TXR 293.
Quit with :quit or Ctrl-D on an empty line. Ctrl-X ? for cheatsheet.
TXR is light and portable; take it camping, or to the Bahamas.
1> (file-get "/proc/sys/net/core/somaxconn")
128
2> (typeof (file-get "/proc/sys/net/core/somaxconn"))
fixnum

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Getting SOMAXCONN

<uqe4v1$1nl53$5@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11424&group=comp.unix.programmer#11424

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Mon, 12 Feb 2024 22:09:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <uqe4v1$1nl53$5@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me>
<uqe02c$1mqnb$4@dont-email.me> <IEvyN.142336$taff.26273@fx41.iad>
<87jzn98i71.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 12 Feb 2024 22:09:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4893208a1e1db25dfdb2200d963d48cb";
logging-data="1823907"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VttEdXPKMtVEKg5UhRuh5"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:1zL2UyxIoZxejIS88BHWLrhi3FY=
 by: Lawrence D'Oliv - Mon, 12 Feb 2024 22:09 UTC

On Mon, 12 Feb 2024 13:51:30 -0800, Keith Thompson wrote:

> scott@slp53.sl.home (Scott Lurndal) writes: [...]
>
>> $ application -m $(cat /proc/sys/net/core/somaxconn)
>
> $ application -m $(</proc/sys/net/core/somaxconn)

Hah! Somebody found a UUOC!

Re: Getting SOMAXCONN

<65ca97b9$0$29768$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11425&group=comp.unix.programmer#11425

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-b.proxad.net!nnrp2-2.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$...@salle-s.org (Nicolas George)
Subject: Re: Getting SOMAXCONN
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <uqbtpc$170j7$1@dont-email.me> <65ca4988$0$3003$426a34cc@news.free.fr> <uqe01h$1mqnb$3@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 12 Feb 2024 22:12:09 GMT
Lines: 8
Message-ID: <65ca97b9$0$29768$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 12 Feb 2024 23:12:09 CET
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1707775929 news-2.free.fr 29768 129.199.129.80:55166
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Mon, 12 Feb 2024 22:12 UTC

Lawrence D'Oliveiro , dans le message <uqe01h$1mqnb$3@dont-email.me>, a
écrit :
>> Why do you think you need it in a program?
> That is normally where SOMAXCONN is needed.

Then you should not have trouble giving a specific answer:

Why do you think you need it in a program?

Re: Getting SOMAXCONN

<uqeggo$1pg7s$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11426&group=comp.unix.programmer#11426

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Tue, 13 Feb 2024 01:26:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uqeggo$1pg7s$1@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me>
<65ca4988$0$3003$426a34cc@news.free.fr> <uqe01h$1mqnb$3@dont-email.me>
<65ca97b9$0$29768$426a74cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Feb 2024 01:26:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="24b9a84a64cf4b4b69a117a024a5ec4b";
logging-data="1884412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ItwCf9xJvRG+dYbw1ApH0"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:F1OQcKoLbKuk5ONJNeUpWpBfEZY=
 by: Lawrence D'Oliv - Tue, 13 Feb 2024 01:26 UTC

On 12 Feb 2024 22:12:09 GMT, Nicolas George wrote:

> Why do you think you need it in a program?

I posted some example code elsewhere.

Re: Getting SOMAXCONN

<uqf6rk$20b7p$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11432&group=comp.unix.programmer#11432

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Tue, 13 Feb 2024 07:48:04 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <uqf6rk$20b7p$1@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Feb 2024 07:48:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="24b9a84a64cf4b4b69a117a024a5ec4b";
logging-data="2108665"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4KskLzMRxWSSrG3kCkqTU"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:9Nk+LSNAfPkrWizbq01yaseIf/E=
 by: Lawrence D'Oliv - Tue, 13 Feb 2024 07:48 UTC

Some documentation suggests that calling listen(2) with a negative backlog
is equivalent to setting it to the maximum possible value. But this is not
documented in any place I’m aware of (e.g.
<manpages.debian.org/2/listen.en.html>).

That page does not mention EINVAL as a possible return status, so perhaps
such out-of-range values are acceptable and will be interpreted reasonably
after all?

If this is true, then there is no need to bother determining the explicit
value of SOMAXCONN.

Re: Getting SOMAXCONN

<65cb23c8$0$29737$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11434&group=comp.unix.programmer#11434

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp2-2.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$...@salle-s.org (Nicolas George)
Subject: Re: Getting SOMAXCONN
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <uqbtpc$170j7$1@dont-email.me> <uqf6rk$20b7p$1@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 13 Feb 2024 08:09:44 GMT
Lines: 7
Message-ID: <65cb23c8$0$29737$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 13 Feb 2024 09:09:44 CET
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1707811784 news-1.free.fr 29737 129.199.129.80:49410
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Tue, 13 Feb 2024 08:09 UTC

Lawrence D'Oliveiro , dans le message <uqf6rk$20b7p$1@dont-email.me>, a
écrit :
> If this is true, then there is no need to bother determining the explicit
> value of SOMAXCONN.

There is no need to determine the value of SOMAXCONN in a program. Read the
man page more carefully, the solution is in it.

Re: Getting SOMAXCONN

<yFLyN.84400$U1cc.69178@fx04.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11445&group=comp.unix.programmer#11445

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.samoylyk.net!3.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx04.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Getting SOMAXCONN
Newsgroups: comp.unix.programmer
References: <uqbtpc$170j7$1@dont-email.me> <uqf6rk$20b7p$1@dont-email.me>
Lines: 30
Message-ID: <yFLyN.84400$U1cc.69178@fx04.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 13 Feb 2024 15:12:30 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 13 Feb 2024 15:12:30 GMT
X-Received-Bytes: 1874
 by: Scott Lurndal - Tue, 13 Feb 2024 15:12 UTC

Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>Some documentation suggests that calling listen(2) with a negative backlog
>is equivalent to setting it to the maximum possible value. But this is not
>documented in any place I’m aware of (e.g.
><manpages.debian.org/2/listen.en.html>).
>
>That page does not mention EINVAL as a possible return status, so perhaps
>such out-of-range values are acceptable and will be interpreted reasonably
>after all?
>
>If this is true, then there is no need to bother determining the explicit
>value of SOMAXCONN.

POSIX says:

"The backlog argument provides a hint to the implementation
which the implementation shall use to limit the number of
outstanding connections in the socket's listen queue. Implementations
may impose a limit on backlog and silently reduce the specified value.
Normally, a larger backlog argument value shall result in a larger
or equal length of the listen queue. Implementations shall support
values of backlog up to SOMAXCONN, defined in <sys/socket.h>."

There's no need to determine the explicit value of SOMAXCONN (128 on
my fedora core installation sys/socket.h). There's no requirement
for the implementation to honor the backlog argument, it's just
a hint.

Re: Getting SOMAXCONN

<uqg279$23ni8$8@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11446&group=comp.unix.programmer#11446

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Tue, 13 Feb 2024 15:35:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <uqg279$23ni8$8@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqf6rk$20b7p$1@dont-email.me>
<yFLyN.84400$U1cc.69178@fx04.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Feb 2024 15:35:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aa13a1720caaa2205b64b7adad483cd2";
logging-data="2219592"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18b5sskqyXxT8ZveV0YOrg220v7vGa4750="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:wS5D77pTl+zjcmBt7RwXwW7PSLA=
 by: Lew Pitcher - Tue, 13 Feb 2024 15:35 UTC

On Tue, 13 Feb 2024 15:12:30 +0000, Scott Lurndal wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>Some documentation suggests that calling listen(2) with a negative backlog
>>is equivalent to setting it to the maximum possible value. But this is not
>>documented in any place I’m aware of (e.g.
>><manpages.debian.org/2/listen.en.html>).
>>
>>That page does not mention EINVAL as a possible return status, so perhaps
>>such out-of-range values are acceptable and will be interpreted reasonably
>>after all?
>>
>>If this is true, then there is no need to bother determining the explicit
>>value of SOMAXCONN.
>
> POSIX says:
>
> "The backlog argument provides a hint to the implementation
> which the implementation shall use to limit the number of
> outstanding connections in the socket's listen queue. Implementations
> may impose a limit on backlog and silently reduce the specified value.
> Normally, a larger backlog argument value shall result in a larger
> or equal length of the listen queue. Implementations shall support
> values of backlog up to SOMAXCONN, defined in <sys/socket.h>."
>
>
> There's no need to determine the explicit value of SOMAXCONN (128 on
> my fedora core installation sys/socket.h). There's no requirement
> for the implementation to honor the backlog argument, it's just
> a hint.

The Linux Programmer's Manual listen(2) manpage says

"If the backlog argument is greater than the value in
/proc/sys/net/core/somaxconn, then it is silently truncated to that value;
the default value in this file is 128. In kernels before 2.4.25, this limit
was a hard coded value, SOMAXCONN, with the value 128."

Yes, the backlog argument is a /hint/, but (apparently) a hint that the
linux kernel takes seriously. And, Lawrence is correct in both his statements
and his implications:
a) in Linux, /proc/sys/net/core/somaxconn authoritatively represents the value
of the maximum number of backlogged connections, while the value of SOMAXCONN
in <sys/socket.h> does not (although SOMAXCONN represents the /default/
value of /proc/sys/net/core/somaxconn)

b) in Linux, /proc/sys/net/core/somaxconn can be increased or decreased dynamically,
meaning that SOMAXCONN does not represent the "current" state of the maximum
number of backlogged connections.

c) to be accurate, a linux program should retrieve the backlog maximum by reading
/proc/sys/net/core/somaxconn, rather than depending on the value of SOMAXCONN
from <sys/socket.h>

d) (My observation) a linux program cannot accurately determine the backlog maximum,
as it might change (either up or down) /after/ the program reads /proc/sys/net/core/somaxconn
In this case, the programmer could just accede to POSIX, and obtain the default
value from <sys/socket.h>, unless the true current maximum is required.

--
Lew Pitcher
"In Skills We Trust"

Re: Getting SOMAXCONN

<65cb94ed$0$7525$426a74cc@news.free.fr>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11449&group=comp.unix.programmer#11449

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.chmurka.net!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-b.proxad.net!nnrp6-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$...@salle-s.org (Nicolas George)
Subject: Re: Getting SOMAXCONN
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <uqbtpc$170j7$1@dont-email.me> <uqf6rk$20b7p$1@dont-email.me> <yFLyN.84400$U1cc.69178@fx04.iad> <uqg279$23ni8$8@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 13 Feb 2024 16:12:30 GMT
Lines: 7
Message-ID: <65cb94ed$0$7525$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 13 Feb 2024 17:12:30 CET
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1707840750 news-1.free.fr 7525 129.199.129.80:60768
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Tue, 13 Feb 2024 16:12 UTC

Lew Pitcher , dans le message <uqg279$23ni8$8@dont-email.me>, a écrit :
> c) to be accurate, a linux program should retrieve the backlog maximum
> by reading /proc/sys/net/core/somaxconn, rather than depending on the
> value of SOMAXCONN from <sys/socket.h>

Wrong: a Linux program should not care what this value is. This is a setting
for administrators, and even a barely useful one.

Re: Getting SOMAXCONN

<uqgm9p$28md6$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11458&group=comp.unix.programmer#11458

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Date: Tue, 13 Feb 2024 21:17:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <uqgm9p$28md6$2@dont-email.me>
References: <uqbtpc$170j7$1@dont-email.me> <uqf6rk$20b7p$1@dont-email.me>
<yFLyN.84400$U1cc.69178@fx04.iad> <uqg279$23ni8$8@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Feb 2024 21:17:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="24b9a84a64cf4b4b69a117a024a5ec4b";
logging-data="2382246"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wtKxSMCNH96L8gJMCfduk"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ooq6hxFjoHO9lEVDvAci7metVYc=
 by: Lawrence D'Oliv - Tue, 13 Feb 2024 21:17 UTC

On Tue, 13 Feb 2024 15:35:05 -0000 (UTC), Lew Pitcher wrote:

> Yes, the backlog argument is a /hint/, but (apparently) a hint that the
> linux kernel takes seriously.

I’ve been looking at the kernel code, to see if I can understand this a
bit more.

Seems each protocol family has its own implementation of calls like
listen(2). For example, the IPv4 implementation can be found here
<https://elixir.bootlin.com/linux/latest/source/net/ipv4/af_inet.c#L190>,
and the unix-sockets version can be found here
<https://elixir.bootlin.com/linux/latest/source/net/unix/af_unix.c#L726>.

You may notice that neither one does much validation of the “backlog”
argument before storing it into the sk_max_ack_backlog field of the struct
sock structure. Which is defined here
<https://elixir.bootlin.com/linux/latest/source/include/net/sock.h#L494>.
And you will note that the field is unsigned (“u32”), while the argument
value being stored into it is signed (“int”).

Re: Getting SOMAXCONN

<20240407173313.54ea08fab5b020b97755f38c@speakeasy.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=11704&group=comp.unix.programmer#11704

  copy link   Newsgroups: comp.unix.programmer
Date: Mon, 08 Apr 2024 19:46:32 +0000
From: jklow...@speakeasy.net (James K. Lowden)
Newsgroups: comp.unix.programmer
Subject: Re: Getting SOMAXCONN
Message-Id: <20240407173313.54ea08fab5b020b97755f38c@speakeasy.net>
References: <uqbtpc$170j7$1@dont-email.me> <uqd7oa$1hn3i$1@dont-email.me> <uqdd00$17sec$1@news.xmission.com>
X-Newsreader: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Lines: 45
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!news.newsdemon.com!not-for-mail
Nntp-Posting-Date: Mon, 08 Apr 2024 19:46:32 +0000
X-Received-Bytes: 1849
X-Complaints-To: abuse@newsdemon.com
Organization: NewsDemon - www.newsdemon.com
 by: James K. Lowden - Mon, 8 Apr 2024 19:46 UTC

On Mon, 12 Feb 2024 15:20:32 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) wrote:

> > cat /proc/sys/net/core/somaxconn
>
> I expect someone will post the COBOL version any minute now.

As Polonius said, "Brevity Is the soul of wit".

IDENTIFICATION DIVISION.
PROGRAM-ID. SHOW-SOMAXCONN.
AUTHOR. On behalf of Kenny McCormack.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SOMAXCONN
ASSIGN TO "/proc/sys/net/core/somaxconn"
ORGANIZATION IS SEQUENTIAL.

DATA DIVISION.
FILE SECTION.
FD SOMAXCONN.
01 DATUM PIC 9(8).

WORKING-STORAGE SECTION.

PROCEDURE DIVISION.
OPEN INPUT SOMAXCONN.
READ DATUM.
DISPLAY "somaxconn is " DATUM.
DIVIDE 1024 into DATUM.
DISPLAY "somaxconn is " DATUM " KB".

$ gcobol -oo read-file.cbl && ./o
somaxconn is 4096
somaxconn is 00000004 KB

gcobol is the ISO COBOL front-end being developed for GCC. The
development platform is Ubuntu, but it has been shown to compile under
Open BSD, too, modulo a few patches.

--jkl

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor