Issues with NodeBB perfomance



  • Hello. I have latest NodeBB version and I have difficulties at running NodeBB forum.

    I can't even see latest notifications.

    Sometimes it even goes down with 503 error



  • Which web server and database?

    Check if some process on system causes excessive load and that Load avarages never go above the cpu core count on server.
    Make sure the server has enough memory and wont run out of it when forum is running.

    You can also try adjusting Traffic management from "Settings --> advanced" to prevent "false" 503 page triggering.



  • I use apache 2.4 and I use mongodb. I checked ram cpu it uses only about 10-20% max



  • Definitely replace Apache with NGINX.
    Can you share your config.json with us maybe?



  • Settings were good



  • @Lukas-Urbonas can you maybe share your NGINX config as well?
    For me your site works fine by the way, at least I do not receive a 502 error.



  • **I get error when I try to get notifications **
    server {
    listen 80;

    server_name otaku.lt www.otaku.lt;
    
    location / {
        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_pass http://127.0.0.1:4567/;
        proxy_redirect off;
    
        # Socket.IO Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
    error_page 502 /502.html;
    
    location = /502.html {
    		root /usr/share/nginx/html;
    		internal;
    }
    

    }


  • Plugin & Theme Dev

    @Lukas-Urbonas do you see any errors in NodeBB logs or browser console?



  • 28/3 12:10 [4224] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    28/3 12:10 [4224] - info: [app] Database connection closed.
    28/3 12:10 [4224] - info: [app] Web server closed to connections.
    28/3 12:10 [4224] - info: [app] Shutdown complete.
    [cluster] Child Process (4224) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...
    28/3 12:10 [6182] - info: Time: Mon Mar 28 2016 12:10:36 GMT-0400 (EDT)
    28/3 12:10 [6182] - info: Initializing NodeBB v1.0.2
    28/3 12:10 [6182] - warn: You have no mongo password setup!
    28/3 12:10 [6182] - info: [database] Checking database indices.
    28/3 12:10 [6182] - warn: [socket.io] Clustering detected, you are advised to configure Redis as a websocket store.

    28/3 12:10 [6182] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset -p PLUGINNAME to disable it.

    • nodebb-plugin-shoutbox

    28/3 12:10 [6182] - warn: [plugins] Skipping /root/nodebb/node_modules/nodebb-plugin-header-extend/public/templates/admin/plugins/script.js by plugin nodebb-plugin-header-extend
    28/3 12:10 [6182] - warn: [plugins] Skipping /root/nodebb/node_modules/nodebb-plugin-header-extend/public/templates/admin/plugins/style.css by plugin nodebb-plugin-header-extend
    28/3 12:10 [6182] - info: NodeBB Ready
    28/3 12:10 [6182] - info: Enabling 'trust proxy'
    28/3 12:10 [6182] - info: NodeBB is now listening on: 0.0.0.0:4567
    28/3 12:10 [6182] - info: [Newsletter] Initializing Newsletter...



  • blacklist returned: undefined
    28/3 12:04 [4224] - error: /register
    invalid csrf token
    28/3 12:04 [4224] - error: /login
    invalid csrf token
    28/3 12:10 [4224] - error: TypeError: Cannot read property 'replace' of undefined
    at S.decodeHtmlEntities (/root/nodebb/node_modules/string/lib/string.js:140:12)
    at /root/nodebb/src/notifications.js:453:60
    at Array.forEach (native)
    at /root/nodebb/src/notifications.js:426:20
    at Array.reduce (native)
    at Object.Notifications.merge (/root/nodebb/src/notifications.js:403:28)
    at /root/nodebb/src/user/notifications.js:96:19
    at fn (/root/nodebb/node_modules/async/lib/async.js:746:34)
    at /root/nodebb/node_modules/async/lib/async.js:1213:16
    at /root/nodebb/node_modules/async/lib/async.js:166:37
    at /root/nodebb/node_modules/async/lib/async.js:706:43
    at /root/nodebb/node_modules/async/lib/async.js:167:37
    at /root/nodebb/node_modules/async/lib/async.js:1209:30
    at /root/nodebb/src/user/notifications.js:139:4
    at /root/nodebb/src/user/notifications.js:185:5
    at /root/nodebb/node_modules/async/lib/async.js:726:13
    TypeError: Cannot read property 'replace' of undefined
    at S.decodeHtmlEntities (/root/nodebb/node_modules/string/lib/string.js:140:12)
    at /root/nodebb/src/notifications.js:453:60
    at Array.forEach (native)
    at /root/nodebb/src/notifications.js:426:20
    at Array.reduce (native)
    at Object.Notifications.merge (/root/nodebb/src/notifications.js:403:28)
    at /root/nodebb/src/user/notifications.js:96:19
    at fn (/root/nodebb/node_modules/async/lib/async.js:746:34)
    at /root/nodebb/node_modules/async/lib/async.js:1213:16
    at /root/nodebb/node_modules/async/lib/async.js:166:37
    at /root/nodebb/node_modules/async/lib/async.js:706:43
    at /root/nodebb/node_modules/async/lib/async.js:167:37
    at /root/nodebb/node_modules/async/lib/async.js:1209:30
    at /root/nodebb/src/user/notifications.js:139:4
    at /root/nodebb/src/user/notifications.js:185:5



  • @Lukas-Urbonas before I can send you a proper config file make sure your nginx.conf looks like this:

    user www-data;
    worker_processes 2;
    pid /run/nginx.pid;
    
    events {
    	use epoll;
    	worker_connections 16384;
    	multi_accept on;
    }
    
    http {
    
    	##
    	# Basic Settings
    	##
    
    	sendfile on;
    	tcp_nopush on;
    	tcp_nodelay on;
    	keepalive_timeout 65;
    	types_hash_max_size 2048;
    	# server_tokens off;
    
    	# server_names_hash_bucket_size 64;
    	# server_name_in_redirect off;
    
    	include /etc/nginx/mime.types;
    	default_type application/octet-stream;
    
    	##
    	# Logging Settings
    	##
    
    	# access_log /var/log/nginx/access.log;
    	# error_log /var/log/nginx/error.log;
    
    	##
    	# Gzip Settings
    	##
    
    	# gzip on;
    	# gzip_disable "msie6";
    
    	# gzip_vary on;
    	# gzip_proxied any;
    	# gzip_comp_level 6;
    	# gzip_buffers 16 8k;
    	# gzip_http_version 1.1;
    	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    
    	##
    	# Virtual Host Configs
    	##
    	include /etc/nginx/sites-enabled/*;
    }
    

    Some parameters maybe need to be edited for your use case, however, there shouldn't be any issues with the config above.
    Now create a folder called sites-enabled in /etc/nginx. Create a file named otaku.conf with this conntent:

    	# Force SSL
    	server {
           	listen         80;
           	server_name    www.otaku.lt otaku.lt;
        	access_log off;
    	error_log off;
    	root /root/nodebb;
    
    	# Max Upload
        	client_max_body_size	100M;
    	
    	# Gzip
    	gzip on;
    	gzip_disable "msie6";
    	gzip_vary on;
    	gzip_comp_level  6;
    	gzip_min_length  1500;
            gzip_proxied     any;
    	gzip_buffers 16 8k;
    	gzip_http_version 1.1;
    	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    
            # Stats
       	# location /nginx_status {
            # stub_status on;
      	# }
    
    	# NodeBB
            location  / {
            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_pass http://io_nodes;
            proxy_redirect off;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            }
    
    	# Cache
        	location ~*  .(jpg|jpeg|png|gif|ico|css|js)$ {
        	expires 1y;
        	}
    
    	}
    	# Close Server
    
    	# NodeBB Upstream
    	upstream io_nodes {
        	ip_hash;
        	server 127.0.0.1:4567;
    	keepalive 120;
    	}
    
    

    Restart NGINX.

    General advice of mine:
    Do not run the forum in the /root directory. I am also assuming you are using the root user to run your NodeBB instance, which is an additional security risk.


  • Plugin & Theme Dev

    @Lukas-Urbonas your installation is crashing with an error when you open the notifications dropdown.

    the title of this topic is misleading. it doesn't have anything to do with your issue and the issue has nothing to do with Apache/Nginx either.



  • @AOKP Thanks, but my website quite broken now. Was It because of new settings or I moved to new user? (I can't access to .css files, it says forbidden, you can see it by yourself.) I made chown to give permission to that new user.





  • @Lukas-Urbonas Mabye I can help you



  • @arionkurtaj so tell me what I should do.


  • Admin

    Echoring @pichalite's quote:

    your installation is crashing with an error when you open the notifications dropdown.
    the title of this topic is misleading. it doesn't have anything to do with your issue and the issue has nothing to do with Apache/Nginx either.

    Hi @Lukas-urbonas, please let me know your git hash... it is possible we have fixed this bug already.



  • @julian It is b81e395a265ea7123688dc5d232a888e3bbf5cdf (short: b81e395)



  • @Lukas-Urbonas Is your host giving you any errors



  • @arionkurtaj Well my .css files not working it says not found.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.