@pitaj So far I haven't been able to test the traffic spikes as I haven't had any lately
I did found a typo in my nginx file which I've fixed already and it seems to run better. I'll report back as soon as I get more data.
@pitaj So far I haven't been able to test the traffic spikes as I haven't had any lately
I did found a typo in my nginx file which I've fixed already and it seems to run better. I'll report back as soon as I get more data.
@pitaj fixed it. Thanks! I was trying with single and double `
Here it's the conf file:
upstream io_nodes {
ip_hash;
server 127.0.0.1:4567;
server 127.0.0.1:4568;
server 127.0.0.1:4569;
server 127.0.0.1:4570;
server 127.0.0.1:4571;
server 127.0.0.1:4572;
server 127.0.0.1:4573;
server 127.0.0.1:4574;
#16 cores:
server 127.0.0.1:4575;
server 127.0.0.1:4576;
server 127.0.0.1:4577;
server 127.0.0.1:4578;
server 127.0.0.1:4579;
server 127.0.0.1:4580;
server 127.0.0.1:4581;
server 127.0.0.1:4582;
}
server {
listen 80;
server_name myserver.tld;
return 301 http://www.myserver.tld$request_uri;
}
server {
listen 80;
server_name www.myserver.tld;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
# Socket.io Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
gzip on;
gzip_min_length 1000;
gzip_proxied off;
gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
location @nodebb {
proxy_pass http://io_nodes;
}
location ~ ^/assets/(.*) {
root /home/myuser/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}
location /plugins/ {
root /home/myuser/nodebb/build/public/;
try_files $uri @nodebb;
}
location / {
proxy_pass http://io_nodes;
}
}
@julian Just checked my nginx conf, it's basically the same as the one in the tutorial:
upstream io_nodes {
ip_hash;
server 127.0.0.1:4567;
server 127.0.0.1:4568;
server 127.0.0.1:4569;
}
> server {
listen 80;
server_name community.nodebb.org;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_redirect off;
# Socket.io Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
gzip on;
gzip_min_length 1000;
gzip_proxied off;
gzip_types text/plain application/xml text/javascript application/javascript application/x-javascript text/css application/json;
location @nodebb {
proxy_pass http://io_nodes;
}
location ~ ^/assets/(.*) {
root /path/to/nodebb/;
try_files /build/public/$1 /public/$1 @nodebb;
}
location /plugins/ {
root /path/to/nodebb/build/public/;
try_files $uri @nodebb;
}
location / {
proxy_pass http://io_nodes;
}
}
So yeah, it seems I'm using nginx to serve static assets
(ninja'd by yariplus)
@pitaj Using Mongo (in Atlas), redis (same instance as NodeBB).
I haven't configured nginx to serve static assets (all images are on imgur), would this help a lot?
I've been exploring ways to autoscale my instances on the cloud, but still working through that.
@pitaj I'm running 8 cores, 8 GB RAM, High CPU intensive processors. (NodeBB spawns 8 process in cluster mode)
When I post something on my social media accounts, the traffic spikes up to 1,300 users and if I do it with several posts, it makes it impossible to get into the site (CPU goes to 100% and stops responding).
Awesomeness. Let's see how it goes
Hey guys,
currently I have my server in Google Cloud and I've been receiving several traffic spikes due to promotions we launch on social media.
I'm wondering, has anyone put their server on the cloud and is using autoscaling (by creating multiple instance groups).
If so, what's your configuration like? How can I scale NodeBB this way? (Those traffic spikes tend to kill my CPU fast).
Thanks.
I had my first server on a Dreamhost Dedicated Server.
Now I've moved it to Google Cloud.
How many users are you going to support?
Done Love it.
Ok, so far I've got it to work using passport-facebook-token and changing julian's sso-facebook plugin:
FacebookTokenStrategy = require('passport-facebook-token'),
and changing:
passport.use(new passportFacebook({
to
passport.use(new FacebookTokenStrategy({
Also:
strategies.push({
name: 'facebook',
url: '/auth/facebook',
callbackURL: '/auth/facebook/callback',
icon: constants.admin.icon,
scope: 'email, user_friends'
});
to
strategies.push({
name: 'facebook-token',
url: '/auth/token',
callbackURL: '/auth/token/callback',
icon: constants.admin.icon,
scope: 'email, user_friends'
});
I'm able to log into my account but I get this error:
Why is the route not found?
Hey guys,
I'm developing an app for my forum.
So far, I've managed to get the Facebook Login in a native way:
Facebook App opens and user authorizes the app.
It returns the access_token and the user info.
My question: How can I use the access_token and send it to NodeBB in order to:
a ) login if the user has registered in the past
b ) create an account
I'm using julian's SSO-Facebook plugin and all my users are registered via Facebook.
Edit: I'm checking the sso-facebook plugin and passport.js to see if I can (somehow) send the response I get to /auth/facebook/callback
Â
I've also found: https://github.com/drudge/passport-facebook-token
But I'm having trouble figuring out how to implement it on NodeBB's /src/routes/authentication.js
Any clue?
@Adam-Poniatowski & @HARIOM-VASHISTH:
I've managed to migrate my NodeBB to Google Cloud and it's running in clustered mode.
However, I'm having issues with traffic spikes which clog my CPU.
Any of you have experience running multiple instances and autoscaling? (or perhaps @julian can give some input here)
Thanks!!!
@hariom-vashisth said in Clustered nodeBB on Apache:
@Esteban-Constante
NodeBB Utilise clusteringNodeBB is a node app, kindly refer NodeBB documentation for Scalability
https://nodebb.readthedocs.io/en/latest/scaling/index.htmlotherwise run NodeBB with PM2 on cluster mode:
here is the command pm2 start app.js -i 0
The -i or instances option can be:
0 to spread the app across all CPUs
-1 to spread the app across all CPUs - 1
number to spread the app across number CPUs
I tried this, however I keep getting messages saying my connection to the forum dropped out.
@hariom-vashisth said in Clustered nodeBB on Apache:
@Esteban-Constante
NodeBB Utilise clusteringNodeBB is a node app, kindly refer NodeBB documentation for Scalability
https://nodebb.readthedocs.io/en/latest/scaling/index.html
Guide refers to nginx, I wonder if Apache will be able to handle the websockets throughout multiple ports as nginx does
Hello, what would be the right way to configure my nodebb to run in clustered mode and on apache server?
@countach If you know JS you can pretty much do anything in NodeBB. I'm doing it with my forum and building the rewards system and customizing it for the needs of my users.
For the app development I'll be doing it in Corona and I'll use NodeBB's API to connect to the forum.
@phit Yeah, I made a new footer with a different id, set the css to that id and it's working now
@Adam-Poniatowski Thanks Adam!
I'm also trying to move to a cloud hosting in order to scale efficiently.
@phit said in Sticky footer:
.col-sm-12.col-lg-12 .footer {
position: fixed;
bottom: 0;
left: 0;
background: #fff;
padding-top: 7px;
border-top: 1px solid #eee;
width: 100%;
}
Not working for me