Forums

[Plug-in: AMR Users] Memory Problem and wp_usermeta (12 posts)

  1. michael walker
    Member
    Posted 8 months ago #

    Using AMR Users with WordPress 3.2.1. My php memory limit (and WordPress limit) is set to 64M – the highest my ISP will permit. When I visit (in the Admin UI) Users > Any AMR Report, I am getting the following message:

    “Fatal error: Out of memory (allocated 30932992) (tried to allocate 42 bytes) in /web1/user270/website/Newsite/wp-includes/cache.php on line 421″

    When I try to ‘re-build the cache’, basically, it times-out, with a message that says "Taking too long, may have been aborted... delete cache status, try again, check server logs and/or memory limit" Following these recommendations unfotunately does not help. The reason for posting here is that I have seen it suggested that this error could be caused by there being too many fields/records in the wp_usermeta table, which this plug-in accesses. Although I only have 389 users, they do have a fair few custom fields and my wp_usermeta table has a total of 18797 records in it. Does anyone know if this actually is the cause and, if so, is there anything I can do to stop it?

    Thanks in advance for any suggestions.

  2. anmari
    Member
    Posted 7 months ago #

    Hi Michael, I should be wrapping up an update which tries to be a bit cleverer about accessing the data, and also if debug mode reports mem usage so one can tell when/where it hits the wall. Should be up in a day or two.

    For now easiest thing is to disable the plugin (or check via phpmyadmin if there are any meta that can be cleaned up - old no longer used stuff from old plugins etc.

    By the way - thanks for posting the stats - always useful to get a feel.

  3. michael walker
    Member
    Posted 7 months ago #

    Many thanks for your prompt and helpful reply - and congrats on an excellent plug-in.

  4. anmari
    Member
    Posted 7 months ago #

    Thanks - 3.0 has updates to help with memory - let me know how you go.

  5. michael walker
    Member
    Posted 7 months ago #

    Thank you - I will!

  6. michael walker
    Member
    Posted 7 months ago #

    Sheesh! - so far, I got this:

    WordPress database error: [MySQL client ran out of memory]
    SELECT user_id, meta_key, meta_value FROM wp_usermeta WHERE user_id IN (712,711,710,709,708,707,704,705,706,703,702,701,700,699,698,697,696,695,694,693,692,691,690,689,688,687,686,685,684,683,682,681,680,679,678,677,676,675,674,673,672,671,670,669,668,667,666,665,664,663,662,661,660,659,658,657,656,655,654,653,652,651,650,649,648,647,646,645,644,643,642,641,640,639,638,637,636,635,634,633,632,631,630,629,628,627,626,625,624,623,622,621,620,619,618,617,616,615,614,613,612,611,610,609,608,607,606,605,604,603,602,601,600,599,598,597,596,595,594,593,592,591,590,589,588,587,586,585,584,583,582,581,580,579,578,577,576,575,574,573,572,571,570,569,568,567,566,565,564,563,562,561,559,560,558,557,556,555,554,553,552,551,550,549,548,547,546,545,544,543,541,542,540,539,538,537,536,535,534,533,532,531,530,529,528,527,780,525,524,523,522,521,520,519,518,517,516,515,514,513,512,511,506,507,508,509,510,505,504,503,502,501,500,499,498,497,496,495,494,493,492,491,490,489,488,487,486,485,779,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,455,456,457,454,453,452,451,450,449,448,447,446,443,783,445,442,441,440,439,438,437,436,434,435,433,432,431,430,429,428,427,426,425,424,423,420,421,422,419,418,417,416,415,414,413,412,411,410,409,408,407,406,405,404,403,399,400,401,402,398,397,396,395,393,394,392,390,391,388,389,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,781,782,784,785)

    WordPress database error: [Lost connection to MySQL server during query]
    DELETE FROM wp_amr_reportcachelogging WHERE eventtime <= '2011-10-07 13:03:29'

    WordPress database error: [MySQL server has gone away]
    INSERT INTO wp_amr_reportcachelogging ( eventtime, eventdescription ) VALUES ('2011-10-08 13:03:29','At 0.083 seconds, peak mem= 29.5 - after get users, we have 388')

    Don't know if this means anything to you?

  7. anmari
    Member
    Posted 7 months ago #

    HI
    looks like no more php memory issues - see last line with peak memory at 29.5

    that leaves a mysql error.
    The querying of the db now uses the wp query facility as much as possible (the idea being that the wp have many great minds working on that!) and that is what is producing that sql from the query parameters passed.

    I googled the "MySQL client ran out of memory" and there may be some things that you can do on your server side. (I am not a mysql expert so will not presume to advise there).

    See also this http://robsnotebook.com/wordpress-mysql-gone-away.
    It may be that in trying to a huge complex mysql query it takes a while .....

    google results also advise that php4 uses more mem than php 5, but most folks should be on php 5 by now.

    Otherwise you could try breaking a report into subreports by some criteria so that each one is querying less data ?

  8. michael walker
    Member
    Posted 7 months ago #

    Many thanks for your help and prompt reply. That was pretty much as I'd understood it too, so I will take the matter up with my host (Although, I am still getting - and I apologise for failing to mention this before - this message, directly under the one I've already quoted: " Fatal error: Out of memory (allocated 30932992) (tried to allocate 48 bytes) in /web1/user270/website/Newsite/wp-content/plugins/amr-users/includes/ameta-includes.php on line 584. ") I looked at the link you provided , but the guy doesn't seem to go past WP 2.8 with his mod. (Actually, looking at the current version of wp-db.php, it looks as if an attempt has been made to deal with this in there, so he maybe feels he doesn't need to).

    I'm not sure I understood you when you said: "Otherwise you could try breaking a report into subreports by some criteria so that each one is querying less data ? "

    For instance, one of my lists shows only those members who fulfil a particular criterion - that is, have an entry in a specific field - but wouldn't the query have to examine each record first anyway, in order to establish whether this criterion had been met? There are only eighteen of these members, but the result is exactly the same. Or did you have something else in mind?

    Anyway, I will post back here if/when I get a reply from my host, in case it helps anyone else in a similar situation.

  9. michael walker
    Member
    Posted 7 months ago #

    Well, I'm not sure if this is progress but... having deactivated the plug-in, waited a couple of days, then re-activated, I do appear at least to have stopped getting the 'Fatal Error' memory messages and I'm no longer receiving the error messages about MySQL database errors.

    However, on attempting to rebuild the cache I get...nothing at all. Which is to say, the cache rebuild just keeps on trying, but never seems to get anywhere. Here's what a sample log says:

    2011-10-13 09:54:53 - At 0.010 seconds, peak mem= 23.3 - before get all user
    2011-10-13 09:54:53 - Started cacheing report user-04
    2011-10-13 09:48:41 - At 0.005 seconds, peak mem= 23.3 - before get all user
    2011-10-13 09:48:41 - Started cacheing report user-03
    2011-10-13 09:47:11 - At 0.005 seconds, peak mem= 23.3 - before get all user
    2011-10-13 09:47:11 - Started cacheing report user-02
    2011-10-13 09:44:16 - At 0.005 seconds, peak mem= 23.3 - before get all user
    2011-10-13 09:44:16 - Started cacheing report user-01
    2011-10-13 09:43:57 - Schedule background cacheing of report: 4
    2011-10-13 09:43:57 - Schedule background cacheing of report: 3
    2011-10-13 09:43:57 - Schedule background cacheing of report: 2
    2011-10-13 09:43:57 - Schedule background cacheing of report: 1
    2011-10-13 09:43:57 - Received background cache request for 4 reports

    This will go on until I clear the cache records, ultimately leading to that 'things have taken too long' message, but that's as far as I can get. Unfortunately, I do not have any other sites running WordPress (and frankly, the way I feel right now, I never will have), so I have not been able to test this out on other installations. Really stumped now. Do I just have to accept that this plug-in just isn't meant for me :(

  10. anmari
    Member
    Posted 7 months ago #

    Hi Michael,
    please don't blame wordpress for this. (It does sound like maybe you had some mysql db errors perhaps)

    (I am currently slightly involved in a site where the designer has put joomla on top of wp (seems lots of graphoc designers like to do that - never mind the complexity it adds - all I can say is I thank the stars that I chose wp a while back )

    This plugin is trying to work around the fact that perhaps data has not been stored in optimal ways (due to other plugins) for reporting needs.

    In an ideal world, for a large amount of data one would look at the desired reporting and design the way the data is stored accordingly.

    Whereas this plugin is a very generic tool attempting to enable a configurable way to report unknown data. If the data is large or complex and/or there are php/mysql/server constraints (as many have due to cheaper shared hosting etc), there are bound to be some problems.

    The last update shifted the load to mysql a bit (away from php).

    re acceptance:

    It maybe that you need to get some one to code a tailored extract aimed at your data.

    However if you're game to try a little more (cause I don't think there is another plugin like this):

    Have you tried simplifying the report query somehow (reduce the fields selecteed to some basic ones ) or reducing the volume of data queried by adding a simple selection of some kind
    Or reducing the complexity of your selection somehow till it "works" ?

    Then you could build up again till it breaks

  11. michael walker
    Member
    Posted 7 months ago #

    Sorry - I appreciate you are trying to help (and indeed are!)but I have to say I am highly unimpressed by WordPress. Having used such as Drupal, Joomla etc, I have never, ever run into as many problems getting almost anything to work as I have with WP - not even phpBB 1! For example, if any ordinary user on my site has the sheer temerity to click on his or her dashboard link, they get about half of one screen that just says:
    "Theme Twenty Ten with 3 Widgets
    You are using WordPress 3.2.1.

    Fatal error: Out of memory (allocated 31195136) (tried to allocate 11 bytes) in /web1/user270/website/Newsite/wp-includes/user.php on line 1080"

    At which point - as you'd expect - the thing just stalls and no further dashboard functions are available. Ridiculously, if I (as Admin, with a ton more stuff on the dashboard) log-in, however, it's fine -no error messages (well, not until I try and do something, anyway.) WordPress was recommended to me by someone who said - 'it's so simple - no complicated set up or fiddling around' so I am doubly disappointed to find that the only reason this is so is because, unless you install 101 add-ons and plug-ins, it does virtually nothing straight out-of-the-box anyway.

    Anyway, rant over...!

    Back on track, I have now defined a list that employs just one field (User name) and still get the messages referred to previously. I've asked my hosts to look into this, but nothing so far. If I ever find out anything I will certainly let you know - and thanks again for your help thus far - it is really appreciated, even if the above doesn't make it sound like it!

  12. anmari
    Member
    Posted 7 months ago #

    Hi Michael,
    sounds like something is wrong with your setup - you should not be having those sorts of problems at all.

    I have several sites running wp and the only time I get problems is when I have caused them myself through trying to do some funky setup and inadvertently redirecting myself, or while developing...before final testing of course!

    Some suggestions:
    that user dashboard problem might be caused by a plugin, sounds like something happen or tries to happen but cannot for users who are not admin.

    Usual debug is to disable all plugins, check if problem occurs, if not then slowly one by one reactivate the plugins testing each time whether you get that problem again. Then you know which plugin is either causing the problem or clashing with another perhaps. Then google the symptoms with the plugin name.

    Maybe open a general question on the forum or at wp-questions, describing the sorts of things and list
    a) your host
    b) do a phpinfo, list versions of php, mysql and possibly phpinfo output. Check what php info says against suggested wp
    http://wordpress.org/about/requirements/
    c) active plugins

    also what has happened to me before (this was with a plugin, but the point is that it was a ftp thing) is that somehow the ftp or an auto upgrade gets corrupted, and a clean install (ie: keep your uploads folder and wp-content and overwrite all others with a fresh wp that you know was okay or just downloaded) sorts things out.

    Any of the above should shine some light on the problem.

Reply

You must log in to post.

About this Topic