XF 2.2 Setting memory_limit in php.ini or \XF::setMemoryLimit(-1); for the specific job I am running?

Orit

Active member
Lately we have had memory problems with saving permissions to our registered usergroup.
We have more than 140K users, all are obviously in the registered usergroup, so it is quite a heavy task...

I was wondering what would be better:
Setting memory_limit as 1024m globally in php.ini,
or adding \XF::setMemoryLimit(-1); in the beginning of the actionUserGroupSave() and actionNodeSave() functions (as a way to disable the memory limit)?

Adding \XF::setMemoryLimit(-1); fixes the problem.
Our server administrator is hesitant to set memory_limit as 1024m in php.ini, so I can't check that. But is it really safe?

Thanks!!
 
Last edited:
That's not how it works.
Adding permissions to a group does not go out and apply it to all 140k users.

the permissions get saved to a group
the user is associated with a group.


Are you using group addons?

How many rows are in your xf_permission_entry table for user_group_id = your_registered_groupid
 
How many rows are in your xf_permission_entry table for user_group_id = your_registered_groupid
To tell you the truth, the way previous admins set the permissions is a mess. This could also be the load when setting permissions. But to get it all in order I need to disable the memory limit...

In my xf_permission_entry table, for user group 2 (registered) we have 139 rows.
 
Back
Top Bottom