MyBB Community Forums

Full Version: High Memory Usage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2011-04-09, 10:37 PM)- G33K - Wrote: [ -> ]OP sent me a dump of the sql which I imported in to a default install of MyBB and I've determined the main problem to be the forumpermissions cache array.

Due to the high amount of forums and mods for each forum the permissions for these end up with a huge array. I'm trying it on different cache systems but I'm yet to see a significant improvement.

When I use file cache the forumpermissions.php cache file that is generated is ~15MB, thats a 15MB array and as soon as php loads it the memory usage shoots up, ~100-150MB with file cache, ~90-100MB with db cache.

I'm in the process of trying memcache, eaccelerator and xcache to compare the results.

Any pointers on how else to handle such a huge array or reduce it?

Hi guys. There is a problem with my database. My website consumes a lot of memory, around 50 mb at average. When there are no users online it shows 30mb usage, which is a lot of memory indeed. As I have referred to G33K's post, can someone help me here too? How did the guy find out that he had problems with forum permissions cache array? I'd like to find out too.
I have exhausted all the other options, I have imported to a new forum and the problems persist. I would be very obliged if someone helps me here. I am eager to provide phpMyAdmin access too. Here is my website debug info
AND THIS IS WITH NO USERS ONLINE!!!!
Quote:Generated in 0.1564410 seconds (92.17% PHP / 7.83% MySQL)
SQL Queries: 12 / Global Parsing Time: 0.0799730 / Memory Usage: 30 MB
PHP version: 5.2.17 / Server Load: 0.19 / GZip Compression: Enabled

Please bump this thread
(2011-12-08, 06:42 PM)sinaqvi110 Wrote: [ -> ]How did the guy find out that he had problems with forum permissions cache array? I'd like to find out too.

Admin CP -> Tools should show the size of each cache. If there's a large one in there then that's it.

If there's nothing of interest there, well, then you just have to debug it. For example you could print out $GLOBALS and see which variable eats space. Or you could print out the memory usage more frequently and see when/where it suddenly jumps up during a requests lifetime.
thanks for bumping the thread Smile. Love MyBB for the support. Hmm the maximum cache size there is 4 mb, which obviously is not causing the problem. How do I print out $GLOBALS variable? Please help me on this one. I have been banging my head against the wall on this one.
make a php file with below content (globalvar.php) , upload to the forum root & run ..

<?php
    define("IN_MYBB", 1);

    require_once "./global.php";

    echo '<pre>';
    var_dump($GLOBALS);
    echo '</pre>';
?>


however, not sure how getting $GLOBALS helps in analyzing the issue ...
Hmm then perhaps you should install the forum on xampp as stated above. Perhaps it will work?
Is there any standard way to tackle this issue? There is no cpu usage log in my cpanel. I am desperate. Perhaps I can post my sql dump?
please bump this thread
if you PM me your admin and ftp details, I'll have a look at it
Great. Here you go, the details have been sent
FURTHER DETAILS, SITE IS HOSTED ON A VPS. And still the host is saying that it is maxing out memory and cpu usage. And there are no plugins active right now, and there are just around 100 users online.
Frostschutz had problems here, something to do with ip ban, he couldn't connect to the server because the server had blocked him. Anyone else up for a view of the database? Frostschutz thanks for trying bro. I am really thankful to you for taking out the time to look at my problem.
(2011-12-09, 11:40 AM)sinaqvi110 Wrote: [ -> ]FURTHER DETAILS, SITE IS HOSTED ON A VPS. And still the host is saying that it is maxing out memory and cpu usage. And there are no plugins active right now, and there are just around 100 users online.
Can you tell your provider name and your vps specs?

The provider is actually a retailer of another hosting company in America.
the details are,
1 GB Ram, 2 CPU Cored Xeon processor.
Which I think is more than enough to handle the site. But I am positive that the database has some problems, because I imported the database to another fresh install of MyBB and still it used around 50 mb of memory, with NO USERS ONLINE, and NO PLUGINS enabled. So that must mean that there are some un optimized tables in the databae. I just need someone experienced to take a look at it.
Frostschutz apparently had some connectivity issues, anyone else care to have a look? I would really appreciate it.
UPDATE: The host has specified that xmlhttp.php is using most of the cpu bandwidth, with the load being a friggin' 22.0. Please help me, I don't know what to do. I dont have that many custom usergroups(only 2).
Here are the global variable details.
41017530:GLOBALS
1639:_ENV
1639:HTTP_ENV_VARS
10:_POST
10:HTTP_POST_VARS
10:_GET
10:HTTP_GET_VARS
653:_COOKIE
653:HTTP_COOKIE_VARS
1759:_SERVER
1759:HTTP_SERVER_VARS
10:_FILES
10:HTTP_POST_FILES
653:_REQUEST
801:templatelist
26:working_dir
1265:error_handler
115:maintimer
178:grouppermignore
155:groupzerogreater
147:displaygroupfields
371:fpermfields
11517456:mybb
767:config
608:db
33934:templates
10008214:cache
6231:plugins
0:pagestarttime
33058:lang
11344:settings
60:version
174:shutdown_functions
231:date_formats
59:time_formats
106:shutdown_queries
22698:groupscache
9:current_page
294:session
10:time
1:mybbgroups
0:user_cache
8:loadstyle
1:load_from_forum
10:style
15:query
3712:theme
50:stylesheet_scripts
10:stylesheet_script
28:stylesheet_actions
6:stylesheet_action
31:page_stylesheet
105:stylesheets
53:already_loaded
0:mybbadmin
10:datenow
25:timenow
32:lastvisit
0:bbclosedwarning
12:admin_dir
173:admincplink
167:modcplink
1323:welcomeblock
0:pending_joinrequests
10:groupleaders
0:unreadreports
69:reported
5:charset
0:bannedwarning
14639:headerinclude
97:gobutton
121:htmldoctype
6007:header
4:copy_year
0:mybbversion
38:task_cache
0:task_image
470:lang_select
46:languages
18:language
8:key
90:lang_options
85:lang_redirect_url
127:auto_dst_detection
2288:footer
136:navbits
41:archive_url
159:closed_bypass
0:colcookie
9:globaltime
2306:parser
0:loginform
160:logoutlink
1673:whosonline
10:timesearch
2:comma
145:forum_viewers
2:membercount
1311:onlinemembers
2:guestcount
1:anoncount
264:doneusers
1590:spiders
0:user
32:botkey
1:botcount
0:invisiblemark
2:onlinecount
5:onlinebit
7:memberbit
3:anonbit
6:guestbit
598:birthdays
374:bdays
1:bdaycount
1:bdayhidden
10:bdaytime
5:bdaydate
4:year
4090:bdaycache
0:hiddencount
695:today_bdays
352:bdayuser
54:bday
5:age
203:stats
65:newestmember
57:mostonline
3:recordcount
10:recorddate
25:recordtime
537:forumstats
49:post_code_string
3699:boardstats
0:forum
1871444:fcache
978236:forum_cache
2303331:fpermcache
0:usercache
0:cached_forum_permissions_permissions
2634738:cached_forum_permissions
2138331:forumpermissions
3444458:moderatorcache
5:excols
24:permissioncache
5:bgcolor
1:showdepth
0:collapsed
2:unread_forums
5:alttrow
62134:forum_list
61506:forums
89127:index
89127:value