Following a huge number of users makes the Home timeline unusable
I don't know exactly what the cutoff point is, but it seems at some point, after following too many users, the Home timeline just won't load anymore. Ecto times out and the API returns a 500 error.
I can say that 13K followers is definitely too much. For most users this should never be an issue, but I do wonder where the cutoff point is. 10K? 5K? Are there other known Pleroma accounts that follow a huge number of users?
The other question is, do we want to fix this, and can it be done without overcomplicating things? It's not like this is a common use-case; typically following this many people is considered spam, and I know Facebook for example has a 5K limit on the number of friends you can have. However this still leaves us with the question, "where exactly is the limit, though?"
I think at least introducing a max_follows
config with a sane default would be a good short-term fix, after which the API responds "You've followed the maximum allowed users" when trying to follow. In the long-term maybe some sort of caching mechanism like ETS could be put to use, which would likely improve the situation for all users anyway.
Related: #2004 (closed) !2858 (closed)