CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Member Role Sync - Out of Memory Error
Pages: [1]

Author Topic: Member Role Sync - Out of Memory Error  (Read 590 times)

zkrebs

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
Member Role Sync - Out of Memory Error
October 21, 2013, 08:11:19 am
On Drupal 7, CiviCRM 4.3.7,

User tries to log in, it doesn't complete, logs this:

assigning role member (5) to user 11188 because they are part of group 22 (contactID: 17370)

They eventually get out of memory error. I have 320MB of Memory.

This was while using the Login and Membership updated sync methods. When I switched it to sync with Cron, the user could log in successfully. Seems to be happening for new members made after recent updates.

Please advise on what the optimal way to grant a 'Member' role immediately after someone buys membership is, or how to fix this problem.

Could it be I have too many users/contacts?

kreynen

  • I post occasionally
  • **
  • Posts: 105
  • Karma: 8
Re: Member Role Sync - Out of Memory Error
October 21, 2013, 08:49:50 am
Quote
I have 320MB of Memory.

You have 320MB of memory allocated to PHP or total?  Is this a server you have full control over or a shared host/VPS solution?

When a Drupal user logs in, CiviCRM's hook_user_login is called along with any other hook_user_login...

https://github.com/civicrm/civicrm-drupal/blob/7.x-master/civicrm_user.inc#L48

The specific user object is used during the login so it really shouldn't matter if you have 10 contacts or 10,000, only the current user is being impacted by that hook and the difference in the amount of memory used to add a role or not add a role on login should be minimal. 

You should install https://drupal.org/project/devel and track the memory usage per page while running htop (or something similar) on the server.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Member Role Sync - Out of Memory Error
October 21, 2013, 08:54:16 am

seems like there might be a bug and/or sub-optimal ways that module might be doing some queries (just a guess). would be good if you can debug and see the queries it is generating (via mysql query log) and why its using so much memory

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

zkrebs

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
Re: Member Role Sync - Out of Memory Error
October 21, 2013, 10:15:52 am
320MB memory limit in php / drupal settings, the server overall has 2GB.

will do my best to debug, wondering if the issue has come up for anyone else.


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Member Role Sync - Out of Memory Error
October 25, 2013, 01:08:24 am
Code: [Select]
seems like there might be a bug and/or sub-optimal ways that module might be doing some queries
Yes, - I've just been looking & have applied this patch
https://github.com/civicrm/civicrm-drupal/pull/76

It's still never going to get through the 24,000 uf records before it gets killed / runs out of memory but it's down from 48k uf records (only half have membership records) & more importantly it's starting at the end most likely to be relevant

It's not a complete fix but it eases the symptoms
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Member Role Sync - Out of Memory Error

This forum was archived on 2017-11-26.