The MU forums have moved to WordPress.org

Memory Problems (16 posts)

  1. shanebecker
    Member
    Posted 17 years ago #

    I've been having memory problems due to my host not allowing more than 8MB. I was wondering what takes up more memory: a. Placing a plugin into the mu-plugins folder or b. placing a plugin into the plugins folder and allowing each blog to select it as an option.

    When a plugin runs as an mu plugin does it upload into memory for every blog or does it upload once and somehow get applied to each blog without much extra memory usage?

    Also, any further tips would be much appreciated.

  2. lunabyte
    Member
    Posted 17 years ago #

    "a" eats more memory, as it's enabled for every user, every time.

    They're loaded for each page view. Load a page, load and parse all mu-plugins.

    Other tip: Don't use shared hosting. MU needs memory to run with any decent amount of users, and to be efficient. 8M really won't get you too far. It's not MU's fault, really. It's just designed to be server software, and it does what's its intended to do very well.

  3. shanebecker
    Member
    Posted 17 years ago #

    Thanks Lunabyte. That's good to know. And I agree. I'm a bit stunned that I only get 8M but I'm trying to see if they'll increase my allowance.

    What hosting service have people found generally works well with mu? What are the traps for young players to look out for? Certainly no one seems to advertise memory allowance!

    Also, for others with memory problems I've posted some excerpts from other helpful posts below. (Didn't help me unfortunately but I'm sure will be of help to others.)

    From: http://wordpress.org/support/topic/82717
    just add this line in your .htaccess file (you add using file manager )

    php_value memory_limit 0M
    it will work better
    NOTE:0=ZERO

    From http://drupal.org/node/29268

    Depending on your host, this can be done in a number of places with the most likely being php.ini or htaccess depending on your hosting situation.
    Add for example:
    • memory_limit = 12M to your php.ini file (recommended, if you have access)
    • ini_set('memory_limit', '12M'); to your sites/default/settings.php file
    • php_value memory_limit 12M to your .htaccess file in the Drupal root

    You will need to experiment with the value that is right for you.

  4. shanebecker
    Member
    Posted 17 years ago #

    Another question. At this stage I can't imagine having any more than 10 WordPress sites. I love the functionality of mu and hope to keep using it.

    Q. From a memory usage perspective would I be better off with mu running these or having a seperate WordPress installation for each?

  5. lunabyte
    Member
    Posted 17 years ago #

    Yeah, but those only work if they allow someone to override them with htaccess. Also, measuring memory in M's with MU is kind of like throwing a bucket of water into a try pond. It needs more. I've got a test box that I allotted only 512M to mysql, and MU it noticeably slow. Not horrible, but page creation times are a couple seconds on average. I bump it up, and they improve.

  6. shanebecker
    Member
    Posted 17 years ago #

    So I guess that means I should go to seperate WP installs rather than use mu (if I'm limited to 8MB) ? What do you think?

  7. lunabyte
    Member
    Posted 17 years ago #

    In my own opinion, MU is probably overkill for 10 blogs. It's really made for 100's or 1000's.

    But, people use it for that every day. If it seems to run OK, but could be a tick faster, try enabling the object cache. Then, try using WP Cache.

    You'd probably get by OK.

    You can find info on these around here, as optimization is a pretty heavy topic.

  8. shanebecker
    Member
    Posted 17 years ago #

    Thanks Lunabyte, you're very helpful. I've done my homework but couldn't quite figure it all out. I found this and followed the instruction:
    "After creating wp-content/cache and making it writable by the web server user, you have to enable the cache manually by editing wp-settings.php and adding the following line right before the line that says wp_cache_init();
    define('ENABLE_CACHE', true); "

    Have I now enabled the object cache or the WP Cache?

    How do I enable the one I haven't yet enabled?

    Any further help would be much appreciated.

    Also, are there any plugins that enable this process as a simple set of check boxes? (I couldn't find any but perhaps a creative developer is reading!?)

  9. lunabyte
    Member
    Posted 17 years ago #

    The way it works, it needs to be defined in the source. "Most" people just add it to the config file, which works well, but where you added it was fine.

    Check the wp-content/cache dir now, and see if you see some files in there.

    The "problem" with making stuff like that into a plugin is that it would require editing core files. Most plugin authors try to avoid that at all costs so that sites don't break when upgraded.

    WP_Cache is a plugin that you'll have to google for.

  10. shanebecker
    Member
    Posted 17 years ago #

    Thanks Lunabyte, I found it have it set up and running. It's good to be heading in the right direction. The 'cache' folder is filling with files as it should so it's working. Unfortunately I'm still getting this error when making large posts:

    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 85533 bytes) in /sites/yuma4/treasurechrist/home/public_html/wp-includes/post.php on line 490

    I added 'post.php' into the list of files allowed to be cached and it still failed. Any suggestions?

  11. lunabyte
    Member
    Posted 17 years ago #

    You mean other than a new host?

  12. shanebecker
    Member
    Posted 17 years ago #

    : )

  13. dizzy99
    Member
    Posted 17 years ago #

    You could try increasing your php memory yourself through .htaccess.

    It may not work and if it does, your host might not be best pleased but something like

    php_value memory_limit 12M

    in your .htaccess file may help.

  14. shanebecker
    Member
    Posted 17 years ago #

    Thanks dizzy99. Tried that and it crashed my site. In my case the memory is set by the server and there isn't anything I can do about it. : (

  15. dizzy99
    Member
    Posted 17 years ago #

    was worth a try :)

  16. drmike
    Member
    Posted 17 years ago #

    Strange that it would crash MySQL. *shrug*

    Go pester your host. That's what you're paying them for. :)

About this Topic

  • Started 17 years ago by shanebecker
  • Latest reply from drmike