Closed ckcr4lyf closed 1 year ago
With recent changes, we are no longer shuffling, and just return (upto) first 50 seeders / leechers
https://github.com/ckcr4lyf/kiryuu/blob/f9b745f732dd5b9da3aa73e08a5de46e035a1fb2/src/main.rs#L142-L152
It would be better if we limit the ZRANGE to 50, this way it is no longer O(N) , and we can cutdown on xfer between redis & kiryuu. Otherwise, a popular torrent leads to heavy load on ZRANGE on cache misses, leading to higher CPU load:
O(N)
With recent changes, we are no longer shuffling, and just return (upto) first 50 seeders / leechers
https://github.com/ckcr4lyf/kiryuu/blob/f9b745f732dd5b9da3aa73e08a5de46e035a1fb2/src/main.rs#L142-L152
It would be better if we limit the ZRANGE to 50, this way it is no longer
O(N)
, and we can cutdown on xfer between redis & kiryuu. Otherwise, a popular torrent leads to heavy load on ZRANGE on cache misses, leading to higher CPU load: