Timeouts on large, old forum

Latest build.
It only started happening about 5 days ago when I ran ./launcher rebuld app to get my SSL certs to refresh, so it’s on the latest test-passed build.

top - 10:07:52 up 20 days,  4:23,  1 user,  load average: 1.00, 1.08, 1.13
Tasks: 197 total,   3 running, 194 sleeping,   0 stopped,   0 zombie
%Cpu(s):  6.9 us,  4.9 sy,  0.2 ni, 87.3 id,  0.5 wa,  0.0 hi,  0.3 si,  0.0 st
KiB Mem :  2323192 total,    53596 free,  1462364 used,   807232 buff/cache
KiB Swap:  2097148 total,  1423420 free,   673728 used.   418652 avail Mem 

Server specs

RAM: 2560MB
CPU: 2 Cores Xeon 4114 @ 2.20
SSD: 40GB

DB stats:

table_name                  | row_estimate | size      
----------------------------------------------------
posts                       | 966206       | 1895 MB   
post_search_data            | 1015948      | 916 MB    
post_timings                | 1337287      | 86 MB     
user_actions                | 1026939      | 77 MB     
permalinks                  | 947149       | 74 MB     
post_custom_fields          | 917466       | 73 MB     
post_stats                  | 917491       | 66 MB     
topic_users                 | 507792       | 48 MB     
topics                      | 41478        | 40 MB     
user_auth_token_logs        | 68343        | 35 MB 

@Falco the page load time on “slow” pages is small, only about 180ms.

The “activity” tab will load for 60 seconds before getting a 502 error.
If i drill into specific users it works, except for those users who have a huge number of posts, where this “502 error” is thrown.

Again, the Unicorn logs show that the process reaches the max time and it’s killed.

I can understand if it’s hitting this limit on page that is trying to load stats for a user with a lot of posts, but I don’t understand why the same issue is occuring when users try to log in?