My discourse speed is very slow

Try it with ezoic switched off, it can be a real bottleneck.

1 Like

@gerhard

Yes we are using Cloudflare CF, but i assume people use CF to speed up the website so thats why we are using it.
And yes, we linked our CF account with Ezoic but we are still not using Ezoic and not serving ads from them. I did not find any way to remove Ezoic integration with my own CF account.

Right now, we are using Digital ocean single droplet, and only this website is hosted on the entire server. Website is served using NGINX which looks something like this, made some values dummy: We r using NGINX because we are also serving AMP pages via PHP on Amazon ERC Number - HowToDiscuss

server {
listen httpsPORT ssl http2;

ssl on;
ssl_certificate         /path/to/pem;
ssl_certificate_key     /path/to/key;
server_name howtodiscuss.com www.howtodiscuss.com;
location / {
    proxy_ssl_server_name       on;
    proxy_pass       http://localhost:port;
    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";
    proxy_ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
        




} 

And our website is already served via Cloudflare, so that should still speed up things but its not seem to speeding it up.

And you mentioned about these, we will try, is this all free to deploy and run, like hosting my entire forum on full Cloudflare CDN, is this 100% free? Can you please tell me exact steps and what way i should follow these to make best ROI?

Also, i tried turning on CF ROCKET loader, but then discourse doesnt work as expected, and also i think if i turn on CF minification of css, js, html files, the emberJs scripts again dont work well and site doesn’t behave as expected. What else can i tweak in my CF account to speed site up without compromising performance and usability of site?

How can we enable GZIP compression and resources compression and minification on discourse and enable server side /client side caching?

Another bug we recently found is that when we goto https://howtodiscuss.com/logs it as admin, it redirects us to https://howtodiscuss.com/logs/logs/ is this a discourse bug in latest version?

We @ahmed_khan1 will soon install the GitHub - discourse/discourse-prometheus: Official Discourse Plugin for Prometheus Monitoring plugin and share stats with you guys.

Also, looking at our current setups, if you have any more suggestions and optimisation advises, please do share. Thanks

Why not just let the internal NGINX do the job?

As i mentioned, we are serving AMP pages, we are doing the AMP routing in NGINX but i did not share the AMP code in the code snippet of NGINX.

Our AMP pages can be accessed on

https://howtodiscuss.com/t/sarahs-discovery-of-weight-loss/28583?amp=1

etc we are serving these via PHP and using discourse API to build these pages on AMP. So thats why we need NGINX to handle the AMP pages routing for us, as discourse does not provide this AMP routing out of the box.

If anyone can help us achieve 100% score on Google PageSpeed & GTMetrix for our website, and grow bigger, please reach us on howtodiscuss.com@gmail.com

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fhowtodiscuss.com%2Ft%2Fsarahs-discovery-of-weight-loss%2F28583&tab=mobile

1 Like

If I were you I wouldn’t try to make a slow site faster. That’s kinda pointless. Start with a site that is fast enough and try to make it even faster. So, first step is finding out why it is so slow. I would do the following:

  • Create a new droplet (for testing purposes) and follow the Discourse setup instructions
  • Don’t add any plugins yet. And no Cloudflare, Nginx etc
  • Restore a backup of your production site
  • Is it fast enough? Good.
  • Add plugins
  • Still fast? Good. If not, try to find the plugin that’s slowing it down.
  • Add Nginx in front of it for all the PHP stuff
  • Still fast? Good. If not, try something else, like
    • try finding out why Nginx makes it slow
    • or running Nginx on a private port for the PHP stuff and trying to put HAProxy in TCP mode in front of Discourse and your Nginx
  • Start using a CDN for static assets or full site CDN – see links in my last post and read those topics carefully. Cloudflare needs special treatment (a template in app.yml etc.) and don’t use Rocket Loader or anything like that.
15 Likes