althea-net / rita

Rita is a routing and billing protocol that allows devices to buy and sell bandwidth
https://docs.althea.net/
Apache License 2.0
90 stars 24 forks source link

Reduce file descriptor usage #899

Open jkilpatr opened 3 months ago

jkilpatr commented 3 months ago

An instance of rita uses more than ten thousand file descriptors in it's normal state. That's crazy and needs to be reduced.

Just looking as lsof it seems to be mostly async/await related.

jkilpatr commented 3 months ago

Some experimentation here shows that this is probably the number of independent async/await executors we have running in various threads. Separating out the executors has been useful for preventing unexpected blocking behavior from causing issues in unrelated parts of the program by hotting the executor thread but clearly is coming at a cost.