Flarum is slow in comparison to NodeBB
- Edited
[deleted] Is there anything we can do about the speed here ? I've even stripped all extensions and it's the same, which doesn't make any sense to me at all.
In the past, focus has been on the extension API. Now that we're approaching stable and a lot of that is squared away, we've gained the ability to try working on other stuff, like performance. @SychO has been working on fixing a N+1 query problem, and has also updated an extension that allows profiling and debugging performance issues. For the coming release we're also planning some updates to the tags extension that fix a performance issue there.
There's a lot that can be done with optimizing performance, and with providing tools to developers so they don't introduce issues in extensions. I'm hoping to see great improvements in the coming releases, but the first step is investigating and finding issues.
By the way, when you disabled all extensions, what kind of numbers did you get? Obviously this isn't a sustainable solution, but it'd be interesting to see how the load is distributed.
[deleted] What shocked me somewhat was that NodeBB also has a native RSS to post plugin which works flawlessly, but that's another story. NodeBB is running under (of course) NodeJS, MongoDB, and a reverse NGINX proxy.
It wouldn't be that difficult to create a 2 way fees support plugin (posting from feed AND providing a feed), but personally I don't have time to maintain it. If anyone is interested in taking this on, I'd be happy to help them through the process.
[deleted] you might that's true. But average Joe will not be able to. In the end to be very successful you need to be "clicky clicky" - I know that at some stages is frustrating - but that's how it roles. If you are an expert yourself you might also use Discourse with ease - but most users won't be
[deleted]
askvortsov By the way, when you disabled all extensions, what kind of numbers did you get? Obviously this isn't a sustainable solution, but it'd be interesting to see how the load is distributed.
Just below the one second mark, which is still much slower than I'd expect.
askvortsov It wouldn't be that difficult to create a 2 way fees support plugin (posting from feed AND providing a feed), but personally I don't have time to maintain it. If anyone is interested in taking this on, I'd be happy to help them through the process.
I actively maintain a script that does this with the Flarum API
[deleted]
GreXXL If you are an expert yourself
After 30 years of IT Infrastructure support and my role as CISO, I'd say that qualifies me as an expert - it's what I do for a living
[deleted] Just below the one second mark, which is still much slower than I'd expect.
How does temporarily removing the custom header and font change things (if at all)?
I'm curious re a few things:
1) Are your Flarum and NodeBB installations running from the same box.
2) Your custom font and header, is this replicated over on your NodeBB instance?
3) Do you run any form of performance metric monitoring, so we may potentially identify any slow-loading queries or such?
Further, would you be able to provide an output of php flarum info
as I am beginning to suspect that you may also have an extension with a number of queries that might be impacting your performance also.
[deleted]
katos Are your Flarum and NodeBB installations running from the same box.
They were, but are not now - see OP
katos Your custom font and header, is this replicated over on your NodeBB instance?
Yes. See https://phenomlab.com/about-the-founder and https://metabullet.com/p/1-founder-s-journey
katos Further, would you be able to provide an output of php flarum info as I am beginning to suspect that you may also have an extension with a number of queries that might be impacting your performance also.
See my reply to askvortsov I stripped all extensions out leaving just core. Still just under 1 second for loading.
[deleted]
askvortsov How does temporarily removing the custom header and font change things (if at all)?
No. I stripped everything out. The custom header, footer, and the font I'm using (which is hosted locally btw), and it's exactly the same
[deleted] Very interesting that it's loading slower than Discuss. Could you check what distribution of load time is coming from server calculations and which is coming from fetching resources?
Also, I assume that debug mode is disabled, but just wanted to make sure. That can add substantial slowdown as it need to recompile assets on every request.
[deleted] I think this is also where ya’ll tech folks who do these things for a living are going to of course feel like a second slower is too slow.
And again. I get it... to a degree... A second is a long time in the modern Internet era. But, for me, if a website as nice as Flarum loads in 1 to 2 seconds, I’m thrilled!!! Sure, if it was node.js, or even mostly a language like Go, it might be faster. But, right at this moment, from a non I.T. / non dev perspective, you will never convince me that these other languages are as easy as a PHP backend, especially on shared hosting.
[deleted]
askvortsov Very interesting that it's loading slower than Discuss. Could you check what distribution of load time is coming from server calculations and which is coming from fetching resources?
The interesting point here is that the TTFB seems to always be 400ms with Flarum on my VPS - both actually (I have two), yet the same hosts with NodeBB, and the TTFB is 151ms
This might be useful
Phenomlab
Metabullet
What version of Flarum are you using in this instance ?
[deleted]
katos Beta 15
askvortsov Very interesting that it's loading slower than Discuss. Could you check what distribution of load time is coming from server calculations and which is coming from fetching resources?
I also experience slowness on my forum. It's quite trafficked and there's a lot of new content being generated every minute, but I often find it slower compared to Discuss.
Especially when posting new posts, I don't think it ever takes less than a second there, while here it's much faster.
Server resources shouldn't be a problem: 4 vCPU for PHP and load is around 1. MySQL is on another (local) server with load below 0.5. It might be that the MySQL configuration is not optimal (although we're constantly tweaking it and performance doesn't change much).
I have plans to add the ReCache extension which could help, I guess. I'm already using Redis queues.
It would be really helpful if Flarum had some kind of instrumentation, for example with Prometheus, to monitor its performance (but I don't even know if it's possible with PHP since "there's no memory").
[deleted]
matteocontrini I have plans to add the ReCache extension which could help, I guess. I'm already using Redis queues.
I'm using this on Metabullet - makes no real difference, sadly.
- Edited
[deleted] I see... I'm building a dashboard to monitor response times and I'd like to enable caching after that, to see if/how it affects performance. I'll give an update in a few weeks hopefully
- Edited