Performance testing upload/download using AntTP

That would make sense. I hadn’t seen any problems until now, but then again, I wasn’t doing too much testing on main. I need to write a test to grind out a bunch of pointer/scratchpad updates and see if more of these shake out. To the end user in Colony, they just get an error and retry, but if I can catch this and do it for them, that would be better.

3 Likes

Hey, so, if you are also using scratchpads, have you saw the same kind of issues as riddim?

2 Likes

It definitley takes longer than it did before to update scratchpads, but I’m not seeing the handshake errors. I do get a bunch of these, but the upload seems to work fine in the end:

2025-07-02T11:19:25.807333Z ERROR ThreadId(04) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:19:26.171001Z ERROR ThreadId(02) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:19:26.431927Z ERROR ThreadId(04) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:19:29.879697Z ERROR ThreadId(05) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:20:10.824592Z ERROR ThreadId(03) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:20:10.835453Z ERROR ThreadId(02) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
2025-07-02T11:20:11.067825Z ERROR ThreadId(05) autonomi::networking::driver: /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/autonomi-0.5.0/src/networking/driver/mod.rs:204: Error processing swarm event: TaskHandlerError: Network client dropped, cannot send oneshot response
1 Like

Thanks for the info. Are we talking dramatically longer?

Based on my notes, it used to take ~1.5 minutes to upload 2 new scratchpads and pointers sequentially with autonomi v0.4.6, now that same function with autonomi v0.5.0 it takes 3.5 mintues. Updates to existing pointers/scratchpads take ~30 seconds to do the same set, which is about what I was seeing before. This is on a mediocre quality wifi connection to my laptop. Its hard for me to quantify read speed because I rearchitected that section my code so it isn’t a fair apples to apples comparison. It is a lot faster, but my code was suboptimal before. Those errors I list above are new though, I didn’t see those before.

1 Like

a funny plot twist now in scratchpad performance.

  1. they got even slower in roundtrip time … I didn’t manage to perform a singled successful handshake anymore before timeouts are hitting. (it just connected :smiley: so when being patient and lucky it might connect eventually via scratchpads; I think I’ll still revert back to handshake-server until the network has resolved this issue consistently (for more than a week of continued running) )

  2. funnily now it’s the write operation that consumes most of the time (as you can see in my last screenshot: after the network upgrade the write operation did finish very fast and we just polled a couple of times until the new state was populated. as you can see here now - the write now takes forever but then the first iteration of the read returns the new state :open_mouth: …)

very very strange … this is from cloud … when running friends on 2 machines in my network I’m seeing consistently communication times of >20 seconds per direction … so >40seconds to communicate back and forth once … which is not fast enough anymore to create a successful webrtc handshake reliably …

7 Likes

That is too bad. But thanks for sharing.

5 Likes

interesting

that flip to writes taking longer is not going away - but the numbers are smaller again and one friends reconnect I did to check if the situation changed for me finished on first attempt over here :open_mouth: (it was reeeally close - but still it was on first attempt and the timeouts didn’t hit)

4 Likes

now this is spectacular

(the argument number there is the amount of bytes - on previous tests it was hard-coded to 50 or so … now it’s variable - but we’re back to fast scratchpads :tada: )

8 Likes

That looks very fast indeed. What do you think changed to make this so much faster than before?

3 Likes

… maybe people recognized their machines were intolerable slow …? … maybe the network started to ignore those super-slow nodes …? …

my suspicion was that it’s slow due to overloaded nodes … and now I’d suspect that somehow we got rid of them (maybe because heavily overloaded nodes don’t earn as well ..?) ..

… sorry but I’m pretty puzzled about it myself too … will be interesting to watch if it stays like this or gets slower again

4 Likes

can you write a quick test that others can run so we can get wider coverage of this?

3 Likes
import asyncio
import time
from autonomi_client import SecretKey, Client, ScratchpadAddress
from secrets import token_bytes


async def main() -> None:
    client_mainnet = await Client.init()
    testpad_privatekey = SecretKey.from_hex("3a728f71282bd68fcbc6da9e335b46c1122e30eb4dc1ab4ba5c96ef65d365f47")

    async def speedtest(byte_length: int) -> None:
        randomdata: bytes = token_bytes(byte_length)
        start_time: float = time.time()
        await client_mainnet.scratchpad_update(testpad_privatekey, 0, randomdata)
        update_time: float = time.time() - start_time
        print(f"Scratchpad-Update time: {update_time:.2f} seconds")

        tmp: int = 1
        start_time = time.time()
        while True:
            testpad = await client_mainnet.scratchpad_get(
                ScratchpadAddress.from_hex(testpad_privatekey.public_key().hex())
            )
            content: bytes = testpad.decrypt_data(testpad_privatekey)
            if content == randomdata:
                population_time: float = time.time() - start_time
                print(f"population time: {population_time:.2f} seconds")
                print(f"iterations: {tmp} - content: {content[:10]}...")
                break
            tmp += 1

    for _ in range(10):
        await speedtest(500)
        print()


if __name__ == "__main__":
    asyncio.run(main())

you can write this into a speedtest.py file - but you need a python environment with installed lib autonomi-client (pip install autonomi-client) to run it with python speedtest.py / python3 speediest.py

5 Likes

(venv) willie@gagarin:~/projects/maidsafe/scratch-perf-test$ python3 speedtest.py
Scratchpad-Update time: 4.62 seconds
population time: 0.69 seconds
iterations: 1 - content: b’\x93\x1a\x01\xbf0\x11|\nTq’…

Scratchpad-Update time: 2.11 seconds
population time: 0.80 seconds
iterations: 1 - content: b’@\xce\x0b\xac#\x8d\x80|\xc5@'…

Scratchpad-Update time: 2.43 seconds
population time: 0.96 seconds
iterations: 1 - content: b’<E\xc7`\xcc\xf4O\xc5j|'…

Scratchpad-Update time: 2.43 seconds
population time: 0.77 seconds
iterations: 1 - content: b’q1\xd3\x16\x1cO\xe1\x0c\xa6\x90’…

Scratchpad-Update time: 2.64 seconds
population time: 0.71 seconds
iterations: 1 - content: b’4\x8ac\x81y\xc2(\x1b\xf3\x1b’…

Scratchpad-Update time: 2.89 seconds
population time: 0.72 seconds
iterations: 1 - content: b"eqFH\xd8z\x02’t\xfd"…

Scratchpad-Update time: 3.03 seconds
population time: 0.73 seconds
iterations: 1 - content: b’\xff\xd1\xb7A\x85\x13,\xd8J\x1f’…

Scratchpad-Update time: 2.63 seconds
population time: 1.34 seconds
iterations: 1 - content: b’\x98\x0c;Ue\xc7\x05\x96\xf2\x7f’…

Scratchpad-Update time: 5.11 seconds
population time: 0.99 seconds
iterations: 1 - content: b’\x9c\xb7\xb7\x98\xaf[p\xd1\xf4\x9b’…

Scratchpad-Update time: 2.79 seconds
population time: 1.01 seconds
iterations: 1 - content: b’sIQ[>\x90\xd4\xcd\xf4\x85’…

5 Likes

Thanks for posting this @riddim. This is a handly little utility.

Mine isn’t that fast on a poor wifi connection:

Scratchpad-Update time: 8.81 seconds
population time: 1.38 seconds
iterations: 1 - content: b’\x93\xf3\n/\x18P@\x8e\xf6\x06’…

Scratchpad-Update time: 5.53 seconds
population time: 2.07 seconds
iterations: 1 - content: b’\xe8\xf0\xee\x1b\x91u0\xad\x81\x8e’…

Scratchpad-Update time: 4.19 seconds
population time: 1.19 seconds
iterations: 1 - content: b’\xfc\xb0-\xe5\xd4k\x87:\xb9='…

Scratchpad-Update time: 3.68 seconds
population time: 1.35 seconds
iterations: 1 - content: b’\x8ba\xb6\xd1\x06\xf3n\x8er\xd4’…

Scratchpad-Update time: 4.31 seconds
population time: 1.13 seconds
iterations: 1 - content: b’\xaa\x8cS\xae\xd9\x0fsB@\xb8’…

Scratchpad-Update time: 3.73 seconds
population time: 1.50 seconds
iterations: 1 - content: b’\n\x98\tCp\xa7\xd8\xa3\xeaU’…

Scratchpad-Update time: 3.76 seconds
population time: 1.13 seconds
iterations: 1 - content: b’_\x0c\x9f*\x8e\xa8\xe0w\xe2\xb2’…

Scratchpad-Update time: 5.01 seconds
population time: 1.10 seconds
iterations: 1 - content: b’\xfd\x05\x96x\xec\x98\x04\xea\xc1*'…

Scratchpad-Update time: 5.11 seconds
population time: 1.32 seconds
iterations: 1 - content: b’3f\xb6\xf2\xcc\xbeD&^\x7f’…

Scratchpad-Update time: 4.59 seconds
population time: 1.20 seconds
iterations: 1 - content: b’Y\x81\x0f\xd18x\x82M\xaa\xce’…

5 Likes

I don’t know what other changes there will be in the future, but it is very encouraging.

2 Likes

Last 2 days time span looks like some crap nodes did get switched off I’m seeing 800k nodes disappeared.

3 Likes

Might be time to run nodes at 35 GB each, instead of gaming the system, by over capacitating.

This is where I’m at now, and I’m still earning well enough with fewer nodes.

I think the network likes my nodes now more.

Although running thousands of nodes was a good stress test for Autonomi. It proved that it is able to keep on going, which shows the resilience of the tech in my opinion.

1 Like

Well, going from 3-5 million to under 100000 would be a really good test. If it handles a shrungage like that we can call it resilient as well :grinning_face:

2 Likes

Our monitoring recorded a significant dip beginning this morning. There was also a sizable dip last week but it was restored after a bit of time. I thought maybe someone’s upgrading strategy is to just pull the plug on a large number of nodes and redeploy them. Wish they would do so in a more controlled fashion, but I guess we’ll see what happens here…

4 Likes