MyBB Community Forums

Full Version: Very High Memory Usage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
Its already mentioned on the first page.
The link is: http://staff.stratics.com. However, it is a closed community, so you may not be able to see much.

The problem is the size of the forum cache. Matt was going to write a plugin that defaults all usergroups to have no visibility, which would hopefully decrease the number of custom permissions.
I experimented around a bit with this. It's harder to do than it sounds, because MyBB's forum permission cache does not work as expected. The caches stores permissions for groups directly, when those permissions are actually supposed to be inherited. While there is code to resolve permission inheritance, it's not actually being used because it's cached directly. So even if you'd set the default to no visibility, the memory would still be wasted like before.

So while you're currently suffering from a complex permission setup, if you change the default you will be suffering from a bug in class_datacache::build_forum_permissions() which currently includes stuff that should be inherited.

Rather than a plugin, you need several code changes here, at least if you want this to work with the permission system. As far as plugins go, it would probably be easy to make one that just displays an error page if someone tries to go to a forum or thread that one isn't allowed to read, by giving the plugin a separate uid<=>fid mapping. That does not prevent stuff like forum search or RSS syndication et cetera though so it's not a 100% solution.

And of course, fixing this properly, anything that currently relies on the redundant cache entries, like MyBB's own inc/functions_search.php and possibly third-party plugins, will be broken as a result. Smile

*sigh* I love MyBB, but the load times just aren't acceptable. If there's no solution, we'll have to move back to vBulletin (booo!). Sad
It has nothing to do with MyBB, it's the way your using it. Are you sure you really need 50 usergroups? I think that's overkill.

One thing you can try is eAccelerator. Very easy to setup, very easy to manage. For a forum using 7 MB of memory, that would drop down to 1 MB.
As I've explained previously, we run a network of websites, each supported by an independent staff of volunteers. These staff prefer to have their own, private fora. Hence, the usergroups. I have trimmed the usergroups down from over 100, but our staff desires the remaining 59.

VBulletin 3.7 was able to handle over 100 usergroups without slowness. I believe that MyBB can be improved to handle caching more efficiently, as well. Perhaps 2.0 will improve this facet of the software.

Meanwhile, Matt mentioned a few times that he would help to develop a plugin to default usergroups to no visibility. This is why I have bumped the thread--not to rehash everything that has already been discussed since I started this thread in April.
If you're willing to experiment, I can whip something up for you.

The following patch removes redundant entries from the forum permission cache. Doing this breaks the permission check used when searching, so it contains a workaround for that as well.

Apply it using my Patches plugin, and see if reduces your forum permission cache size any after rebuilding. For me it goes from 6kb to 4kb. For you, it probably won't change too much since you have to set 'canview' to 0 for lots of groups/forums manually. It depends on whether that's single forums or entire categories with subforums you have for your groups.

Also test if your permissions still work afterwards. If there's any problem, just revert the patch and rebuild the permissions cache again.
Cool! I'll give it a shot. Smile
I'm curious. Did this help you at all?
One other things about groups is to remove all permissions for the group except the ones absolutely needed. Remove post ability, remove edit ability, pms, all of it. That's for the private groups. But make sure all members in a private group are also in a member group that does have those permissions.

Then in the forums it's much easier to set access because by default the groups all have no access. You then assign the yes permission for each of the groups for their private forums.

I've done this and it lowered my forum cache pretty well.

Personally I think OP is stuck in VB land unable to think in terms of how MyBB works.

Right now I have about 20 groups with 20 private forums.

I also wish that any 0 perms not be in the cache and that MyBB simple set 1 perms. It would save a lot more space in the cache. A LOT MORE. It would speed things up considerably.
Pages: 1 2 3 4 5 6 7 8