Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 1805

[3.3.x] Support Forum • PHP runs out of memory on viewtopic

$
0
0
Support Request Template
What version of phpBB are you using? phpBB 3.3.13
What is your board's URL? not publicly accessible right now
Who do you host your board with? on "bare metal" in data center
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Fresh Install
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What extensions do you have installed? StopForumSpam
What styles do you currently have installed? Carbon
What language(s) is your board currently using? default BE
Which database type/version are you using? MariaDB
What is your level of experience? New to phpBB but not PHP
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? Migrated from vb3, then manually set/fixed permissions for groups so everything is nice and clean again.
Please describe your problem. PHP runs out of memory on various actions (i.e. most noticeably viewtopic).
We could trace back the cause to auth.php-->acl_raw_data() . Memory usually runs out after the query in line 670++ runs (confirmed by watching the process list in DB as well as dumping queries to error-log).
The last actual query being sent when attempting to view any topic/post before running out of memory (I simply added an error_log to driver/mysqli.php to grab this) is this:

Code:

    SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option    FROM bb_acl_groups a, bb_user_group ug, bb_groups g, bb_acl_options ao    WHERE a.auth_role_id = 0 AND a.auth_option_id = ao.auth_option_id    AND a.group_id = ug.group_id    AND g.group_id = ug.group_id    AND ug.user_pending = 0    AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)    AND ao.auth_option = 'a_'
Browsing the forums/categories themselves works fine, as does the ACP and everything else.

I'm not quite sure what this function and those queries are supposed to be doing, but as it apparently returns at least one row per user_id and forum_id, that alone means at least 15.6 million results, and that's just one of the queries being performed here.
I did increase the php memory limit to 5GB "for fun", but even that wasn't enough to fit in whatever is going on in that function, and obviously I don't want to ever have even close to 5GB allocated to a single PHP process.

I'd be very happy if someone could explain the purpose of this function and why there's ever a need to get the permisisons of all users for all forums at once in the first place.
And obviously curious about how any ways to fix this mess we've gotten ourselves into.

I assume we're making a fundamental mistake in our setup of permissions or others would have this same issue?
Generated by SRT Generator

Statistics: Posted by Senshi_x — Mon Nov 18, 2024 9:22 am



Viewing all articles
Browse latest Browse all 1805

Trending Articles