[Solved] New nodebb install running very slow


  • So in my learning as I'm going development of a site for a group of friends I set up a digital ocean droplet (the smallest size one) and install the ghost blog platform on the main domain and nodebb for the forum. subdomain and the reverse proxy stuff is being handled by nginx. However with this install I'm having an issue with nodebb running very slowly, for example when I launched it for the first time and went to the forum.domain.com address the top navigation bar loaded pretty much straight away but the categories didn't for about 8 seconds.

    Now this is the first time I've had more than one node.js app running on the same VPS so I'm wondering if I need to use a bigger droplet (Though I did try a 2 core 2Gb resize though that seemed to make no difference) or if I've screwed up the nginx setup somehow (though I would have thought that would slow down the ghost blog as well, which is running fine.) or if something else I can't even think of is happening (likely, I am not a bright man).

    Any help/thoughts would be appreciated.


  • Actually playing around with it a bit more the slowdown is ONLY occuring when I go back to the main landing page of the forum, it loads in the nav bar then you are sat there waiting for a few seconds before it pops the rest in, also the nav bar doesn't show you as logged in until the delay is over.

    Everything else is lightning fast as always.


  • Also noticed this in the admin panel which I think is different from normal, are they meant to be so many active users when the admin account is the only one created so far?

    error.jpg

  • Admin Staff

    About active users that title is misleading. That section shows active sockets in rooms. You probably have 4 sockets active in those rooms. Can you check your network tab and see if the slowdown is caused by an xhr call on the homepage? Are sockets working as they should instead of falling back to xhr?

  • GNU/Linux Admin

    Yeah, a @baris mentioned, it sounds like websockets isn't working properly. Are you perchance using CloudFlare as well?


  • @julian

    I'm not using any external service, but I'm getting the same message in my ACP about Active Users X socket connections.


  • @baris said:

    Can you check your network tab and see if the slowdown is caused by an xhr call on the homepage? Are sockets working as they should instead of falling back to xhr?

    Sorry but where is this network tab?

    @julian said:

    Yeah, a @baris mentioned, it sounds like websockets isn't working properly. Are you perchance using CloudFlare as well?

    No just a digital ocean droplet, nothing special at all. Is there any special setup I need to do to my nginx settings to enable websockets?

  • Admin Staff

    I meant the network tab of the browser. F12 to open it up if on chrome. I think you need nginx 1.3 or greater for proper websocket support. @julian can correct me if im wrong.


  • @baris Ok yes it's falling back on xhr.

    I have managed to update my nginx to 1.4.5 which has websocket support but I'm still facing the same issue, it's obviously something with the config so will look into that.


  • FIXED IT!

    Just need to add some extra proxy settings to my sites configuration in nginx once I was on a suitably up to date version. 🙂

    Thanks for the pointers. 👍


  • @Sp4rkR4t

    What were those "extra proxy settings"?

  • GNU/Linux Admin

    I'm assuming they were these:

    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade"
    

  • Yes, that's them alright. 🙂


  • @julian said:

    I'm assuming they were these:

    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade"
    

    awe man, 😞 I have those same settings and also getting really bad performance.

  • GNU/Linux Admin

    @Ezra-Sharp What's your nginx version? Should be > v1.3.13


  • Nginx 1.4.7

  • GNU/Linux Admin

    Hm... got a link to your site running live? I'd like to see this for myself...


  • @julian im having the same problem but for apache, i need some help pls

  • GNU/Linux Admin

    @Watchopolis Hm, I'm getting a websocket error. Did you follow this guide to set up the proxy for Apache?


  • @julian yes i followed everything step by step,

    look here on the sidebar stats, the numbers are loading after 6 seconds when the page fully loads

    btw i dont have proxy_wstunnel installed because i am using vestacp

    if i follow this guide will it break my vestacp ?

Suggested Topics

| |