Skip to content

Migrate to asyncio#31

Open
seqizz wants to merge 5 commits intoinnogames:masterfrom
seqizz:g_asyncio
Open

Migrate to asyncio#31
seqizz wants to merge 5 commits intoinnogames:masterfrom
seqizz:g_asyncio

Conversation

@seqizz
Copy link
Copy Markdown
Contributor

@seqizz seqizz commented Feb 3, 2026

Looks like asyncore goes bye-bye with Python 3.12, this is an attempt to implement asyncio.

Functionality-wise it looks on-par, performance is not worse.

Benchmark results
Servers (24): xx0db.gp.ig.local xx0w1.gp.ig.local xx10db.gp.ig.local xx10w1.gp.ig.local xx16db.gp.ig.local xx16w1.gp.ig.local xx18db.gp.ig.local xx18w1.gp.ig.local xx1db.gp.ig.local xx1w1.gp.ig.local...
Command: hostname
SSH: exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oLogLevel=Quiet -t %(host)s %(port)s
Runs: 5 (+ 1 warmup)

--- Old (asyncore) ---
Command: /tmp/polyshmaster/result/bin/polysh --ssh exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oLogLevel=Quiet -t %(host)s %(port)s --command hostname xx0db.gp.ig.local xx0w1.gp.ig.local xx10db.gp.ig.local xx10w1.gp.ig.local xx16db.gp.ig.local xx16w1.gp.ig.local xx18db.gp.ig.local xx18w1.gp.ig.local xx1db.gp.ig.local xx1w1.gp.ig.local xx2db.gp.ig.local xx2w1.gp.ig.local xx3db.gp.ig.local xx3w1.gp.ig.local xx5db.gp.ig.local xx5w1.gp.ig.local xx6db.gp.ig.local xx6w1.gp.ig.local xx7db.gp.ig.local xx7w1.gp.ig.local xx8db.gp.ig.local xx8w1.gp.ig.local xx9db.gp.ig.local xx9w1.gp.ig.local
Warmup runs: 1, Measured runs: 5
  Warmup 1... 3.095s
  Run 1... 3.141s
  Run 2... 3.014s
  Run 3... 2.931s
  Run 4... 3.271s
  Run 5... 3.014s

--- New (selectors) ---
Command: ./result/bin/polysh --ssh exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oLogLevel=Quiet -t %(host)s %(port)s --command hostname xx0db.gp.ig.local xx0w1.gp.ig.local xx10db.gp.ig.local xx10w1.gp.ig.local xx16db.gp.ig.local xx16w1.gp.ig.local xx18db.gp.ig.local xx18w1.gp.ig.local xx1db.gp.ig.local xx1w1.gp.ig.local xx2db.gp.ig.local xx2w1.gp.ig.local xx3db.gp.ig.local xx3w1.gp.ig.local xx5db.gp.ig.local xx5w1.gp.ig.local xx6db.gp.ig.local xx6w1.gp.ig.local xx7db.gp.ig.local xx7w1.gp.ig.local xx8db.gp.ig.local xx8w1.gp.ig.local xx9db.gp.ig.local xx9w1.gp.ig.local
Warmup runs: 1, Measured runs: 5
  Warmup 1... 3.005s
  Run 1... 2.847s
  Run 2... 3.043s
  Run 3... 3.442s
  Run 4... 2.803s
  Run 5... 2.949s

Old (asyncore) (5 runs):
  Mean:   3.074s
  Median: 3.014s
  Min:    2.931s
  Max:    3.271s
  Stddev: 0.133s

New (selectors) (5 runs):
  Mean:   3.017s
  Median: 2.949s
  Min:    2.803s
  Max:    3.442s
  Stddev: 0.255s

=== Comparison ===
  Old mean: 3.074s
  New mean: 3.017s
  Diff:     -0.057s (-1.9%)
  New is 1.9% faster
  Median diff: -0.065s (-2.2%)

Also added a flake to make some stuff easier, can be ignored.

@seqizz seqizz marked this pull request as ready for review March 27, 2026 15:33
@seqizz seqizz requested a review from kofrezo March 27, 2026 15:33
version = "0.16.0"
description = "Control thousands of SSH sessions from a single prompt"
readme = "README.rst"
requires-python = ">=3.5,<=3.12"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update this :-)

Copy link
Copy Markdown
Contributor

@kofrezo kofrezo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes seem not to work on my computer it will never establish a connection maybe I am holding it wrong - lets check together.

Screenshot From 2026-04-02 09-37-20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants