buddyboss / buddyboss-platform

Full featured social networking plugin for WordPress.
https://www.buddyboss.com/platform/
GNU General Public License v2.0
202 stars 90 forks source link

Live Loading > Improve the speed of loading live contents #323

Closed eisenwasser closed 3 years ago

eisenwasser commented 4 years ago

Is your feature request related to a problem? Please describe. We currently allow live loading of content in Activity Feed, and also in the dropdowns in the titlebar. And soon we will have it in Messages also - https://github.com/buddyboss/buddyboss-platform/issues/322 However because it depends on WordPress heartbeat API it is very slow. It is not immediate like Facebook.

Describe the solution you'd like Research and get creative to figure out how to make all of this content load instant or near instant without destroying performance. For Messages, note that eventually we will want to show dots animation indicating that the other user is currently typing, like you would see in WhatsApp. That's how far we want to go. See what is possible.

Describe alternatives you've considered Consider using third party services and APIs.

Related Issues https://github.com/buddyboss/buddyboss-platform/issues/322

joblux commented 4 years ago

Since 4.6 and prior, bb site is getting extremely slow. Its becoming untweakable.

eisenwasser commented 4 years ago

Since 4.6 of what? of WordPress?

joblux commented 4 years ago

yep

eisenwasser commented 4 years ago

@joblux I'm not really sure how WP 4.6 would impact the site speed to be honest. This is the first I have heard of this.

You should know that we are actively working on the task described in this issue, of caching our API requests. The official API will be released soon, in May or June. We are working on caching API endpoints and once that is ready, a huge percentage of data requests in the site will be cacheable. This should make very substantial improvements in performance, and reduce the requests to the server by a large amount, possibly by 50% for some sites.

eisenwasser commented 4 years ago

Almost any performance issue from BuddyBoss is coming from the database requests, which is not related to WordPress 4.6 or to CSS optimization or anything like that. The reality is, this is a social networking software and so the content is changing frequently and has to be served live, and so there are a lot of database requests. That is the primary bottleneck to performance improvements, that we cannot cache pages and also have live content. So we want to cache the database requests on a per-user basis, with intelligent cache purging based on events, so that the data is always up to date for each user. It's a very complex task but will provide substantial performance gains.

joblux commented 4 years ago

Thanks for shedding some light on my end user remark. As you should know i am no It professional but i am not the only one noticing a slow when wordpress updates, might not be wordpress himself at all. Anyhow, i cant wait to see the new api cache update with BB, one thing is striking is the difference between mobile and desktop speed. Mobile is wayyyyy behind. any recommendatiosn how we can relieve that ?

eisenwasser commented 4 years ago

Mobile is mostly limited by if you are on a cell phone connection vs WIFI, could make it slower. Also the mobile browser (depending on your phone) might not be as capable at rendering Javascript efficiently as a web browser. Ultimately - whether you are on phone or desktop you are loading the exact same website (same CSS files etc) and the same amount of database requests. The only difference really is some media queries targeting mobile CSS/JS. So in theory in a totally fair test they should be approx the same speed.

Either way, we are doing what we can to speed things up. As I mentioned above the database queries (and server) is 80% of the performance. Minified CSS/Javascript etc is good, and we do that stuff, but it only actually matters on the first page load, after that your browser caches all of that stuff anyways. To reduce database queries there is no quick magic fix, it's a big complex project. But we are working on it!

joblux commented 4 years ago

and yet it is 65 % + of social network traffic ... most users dont even want an app although we are considering it ... we use really good DB but any advice on how on our hand we could tweak that up to improve page load on cell phones to bridge that huge gap between mobile and desktop would be helpful.

eisenwasser commented 4 years ago

@joblux

Are you using Cloudflare? If you run the site through Cloudflare they will add CDN for assets and will compress images for mobile. They do all this in the background for you, makes some difference. Database - make sure your server has enough RAM and CPU. Contact your host to make sure you are not maxing out.

ExoGeek commented 3 years ago

@eisenwasser Are you still working on this topic ? I understand that speed is very correlated to server performance but even on your BuddyBoss Online-Community demo website, the global activity page feed takes a lot of time to load (more than 5s in my case). And I assume that you already have optmized your server.

So, even with a powerful server (well configured) as yours, the loading speed is always an issue.

But I understand that it is a tough job !

Do you have a plan to optimize the loading speed ?

eisenwasser commented 3 years ago

@ExoGeek

Yes we are still working on this.

The slow activity feed is not directly related to this issue. It is more related to the document activity live previews. If you remove any documents it loads much slower. That is a separate issue of high importance.

We also will be bringing out API caching system that we built for the BuddyBoss App into the Platform. The main project there is to convert web templates to be able to use APIs and then they will get cached with our already built API caching system. This will provide very noticeable improvements in repeat visits and total scalability (less database requests overall).

Aligiannis commented 3 years ago

Hello! At my site the "auto-refresh activity" does not works at all. With buddypress it worked, new posts instantly appeared. I switched to buddyboss and unfortunatelly does not work. I also tested in a fresh installation without any other plugin and did not work. What could be the problem? Thank you

marcjmcdougall commented 3 years ago

Any updates on this? I have my client on a dedicated, highly optimized server and their activity feed still takes 5s+ to load when there are more than a few hundred people using the website concurrently.

I have disabled the comments on activity posts and that seems to help, and also reduced the number of posts that shows up per page to three, but it still takes quite a long time to load. Is there anything else I can do here? Or is the BuddyBoss activity feed simply unusable once you go past a certain # of daily users?

mikejyoung commented 3 years ago

I am closing this issue as it was predominately added here for tracking. We are now tracking planned features inside of our Product Board software.

We have been working on this feature in a separate r&d environment. When we are ready to implement the into the BuddyBoss Platform, we will create new scoped issues to this repo.

sfraise commented 3 years ago

Possibly give option to use a baas like firebase instead of heartbeat for the real time live updating. Or possibly websocket functionality in graphql?

werkmind commented 1 year ago

any updates? On the official roadmap it shows as planned since 2021... i would love an update status on the roadmap page

schipkeb commented 1 year ago

Hey, I'd love an update on this as well, the speed to load the activity is very slow.. Thanks!