I also think it was MongoDB as well because I noticed that the database was set to "0" (default MongoDB on NodeBB setup) and when I changed it to the nodebb database it was as if it was default. Very frustrating but considering the forum was relatively new, not much was lost.
How to Speed Up My Site On NodeBB?
-
Hello All!
Though the site runs on VPS, it still loads slowly when compared to other sites on the same server. As you might be knowing a slow loading site is a dead one.
In WordPress, there are caching plugins and customization options to enable faster loading of a website.
In a similar way, I'm looking for tips to speed up my nodeBB forum.
-
Have you looked at the scaling docs?
-
@PitaJ said in How to Speed Up My Site On NodeBB?:
Have you looked at the scaling docs?
I can attest that this config fairly rocks. Proxy for static content access coupled with Redis for session management. Yippie yi-yo kiyah!
OTOH: Targeting KISS, I'd just rock a single mongod and scale vertically, i.e. toss more $$ at it...
Note: Were I to run a sharded/replicated mongodb backend then I'd seriously consider having mongod handle session management and cut redis. My $0.02. You get what you pay for. If'n yer' lucky & I'm having a good day....
-
Thank you ...will look into it.
-
Hey guys!
What about cronJobs on multiple instances? Are they executing on every instance of nodebb or only on first for example?
-
Ok guys I have found the answer:
In prestart.js there is:
nconf.set('runJobs', nconf.get('isPrimary') && !nconf.get('jobsDisabled'));
And cronJobs are only run:
if (nconf.get('runJobs')) { require('./notifications').startJobs(); require('./user').startJobs(); require('./plugins').startJobs(); }
So it is well thought-out.
-
@cryptoethic if you have multiple servers, set jobsDisabled: true on all servers except the first one.
-
@baris is it possible to have a separate instance just for running jobs?
-
It can be done by using a load balancer, for example create 3 servers A, B, C. Set
jobsDisabled: true
on B & C and add them to the load balancer. A will run the jobs but won't get any traffic. -
@PitaJ A separate process just for running jobs would be ideal and future-ready, though we don't do that currently.