markqvist / Reticulum

The cryptography-based networking stack for building unstoppable networks with LoRa, Packet Radio, WiFi and everything in between.
https://reticulum.network
MIT License
2.06k stars 130 forks source link

[Question] Performance & RAM usage #437

Closed ReimuNotMoe closed 9 months ago

ReimuNotMoe commented 9 months ago

Hi, I would like to get Reticulum running on a MT7628 router board with 64MB RAM. Do you think the CPU performance & RAM size are enough?

faragher commented 9 months ago

No. The current Python implementation, at idle, is around 400 megs according to top. I had a 1 gig server that ran well until a file transfer was requested, then it would crash due to lack of memory. Upgrading to 4 gigs shows it peaks just under 2 gigs. So for a simple router, I'd say 1 gig RAM is about the minimum, maybe 512 with a super lean OS. 2-4 gigs is the best bet for something running a node.

Other implementations aren't complete, and we can't judge their memory footprint at this time. I expect them to be lower once mature, but until they're complete, it's not very helpful to speculate.

markqvist commented 9 months ago

I think the 400 megabytes at idle would be the virtual memory; all memory areas mapped into the virtual address space of the process.

The resident memory, the actual amount of memory used specifically by the process, sits at around 37 megabytes for an idle rnsd on my system (with only a couple of interfaces). This number will obviously go up as you add interfaces and path tables grow, so 64 megs of RAM will still be to small, currently.

Memory usage can be optimised a lot though, and I hope to be able to do that in the relatively near future.