I have run some tests to check the memory usage.
The redis INFO command was reporting 811kb at the beginning since I was running the tests on db1. An empty NodeBB installation starts with roughly 405kb of memory usage.
start 811.44 kb
**Users **
100 users 1.04M diff (254kb) per user = 2.54kb
1000 users 3.61M diff( 2,885kb) per user = 2.885kb
10000 users 29.88M diff( 29,786kb) per user = 2.97kb
Posts (500 chars each)
336 posts 30.71M diff(849kb) per post = 2.52kb
996 posts 32.70M diff(2,887kb) per post = 2.89kb
9995 posts 54.39M diff (25,098kb) per post = 2.51kb
The memory usage per user is roughly 3kbs at 10,000 users. This value goes up as we have other structures that grow as the user count grows.
The memory usage per post is about 2.5kbs per post, keep in mind the posts I created are all 500 characters long.
So for 2,000,000 posts and 400,000 users :
2,000,000 x 2.5kb + 400,000 x 3kb = 5.9gb
So theoretically 6gb should be enough.
Hope that helps.