MyBB Community Forums

Full Version: my server constantly running out of memory, mostly from mysql usage.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

Im operating a board with 30 k members ,60 k posts and more than 10 k created threads.
The message board has highly intensive traffic, many mysql access, lots of images within user`s threads. What was happening is my VPS was constantly running out of memory, mostly from mysql usage. I talk with the online support from my hosting company and they confirmed it was about the message board. I moved my forum now to a dedicated box Intel Core i3-2120 CPU 3.30GHz with 8 gb ram and in about 2 weeks consumed already 7 gb ram.
Wandering if something is wrong with plugins i have installed. I posted bellow the list of my active plugins:
Plugin Controls
-Admin IP Match Plugin (1.3)
-Disable portal.php Plugin (1.1)
-Awaiting Activation Message (1.6)
-Advertisement in Posts (0.1)
-Awards (2.0)
A advanced awards system
Created by Nickman
-ChangUonDyU - Extra File Chatbox (3.6.0)
Chatbox using file system
Created by ChangUonDyU
-Group Notice (1.0)
Allows you to set a notice displayed to certain groups.
Created by Jammerx2
-Usergroup Legend by HSC Community (2.0)
Show a legend of your selected usergroups.
Created by Mihu
-Hide Links to Guests (1.0)
Show a message to guests instead of links.
Created by DragonFever
-IP Hider (0.1)
Allows you to hide IPs from Non-Admins.
Created by Yaldaram
-My Advertisements (1.9.2)
This plugin adds a powerful advertisements manager to your forum.
Created by Pirata Nervo
-Nofollow link (1.0)
A simple plugin that puts nofollow in your links
Created by TimB.
-PM Spy (1.0)
Gives admins the ability to look through their forums private messages.
Created by Mod Hidden
-Profile Buddies (1.4.1)
Enhances the profile of all members with a list of their own buddies.
Created by Sebastian Wunderlich
-Remember us? (1.4)
Sends out e-mail reminders to users.
Created by Aries-Belgium
-RSS Feed Poster (1.0)
Auto creates posts from RSS feeds at specified intervals
Created by vbgamer45
-Minimum of posts to be able to create signatures. (1.0)
It sets a minimum number of posts for your users in order to create signatures.
Created by babjusi
-Sitemap Generator (1.4.0RC2)
A powerful plugin to easily create and manage sitemap files of your MyBBoard
Created by mavericck
-Stop forum spam (1.0)
Prevents users who are listed at http://www.stopforumspam.com from registering.
Created by TimB.
-Tag Cloud (0.1)
Allows you to add a box under whos online containing Tag Cloud.
Created by Yaldaram
-Thread Suite (0.1)
A complete solution for your forum threads.
Created by Yaldaram
-Undo Delete (1.2.1)
Allows you to restore deleted threads, posts, polls and attachments.
Created by Sebastian Wunderlich
-Username Style (1.0.4)
This plugin adds the username style to your portal, forum index and thread index page.
Created by Phenomenon
-Youtube BBCode (1.0)
Put videos in posts. Ex: [youtube]http://www.youtube.com/watch?v=b89cfvrE31[/youtube]
Created by Alex


Please help me.
What are you queries for the main pages index.php, showthread.php, and forumdisplay.php?
Just copy paste each of the admincp footer statistic message for them. That will start to help figure out which page has the most problems.

Likely you have either a misconfigured server or bad plugins which are not optimized.

Also be aware it's normal for a linux server to consume all bandwidth. However your load should be normal. I have a 24GB memory server and only 6GB is free.
Hello labrocca and thanks for answering.
I have visited you forum now, are you talking about the one you have one your sig? Did it consumed around 14 GB ram in a month ?! ConfusedConfused


I have posted bellow from my board`s statistics:


Overall Statistics
Date Users Threads Posts
03-26-2012 28,742 (Increase 75) 5,940 (Increase 1) 47,729 (Increase 85)
03-25-2012 28,667 (Increase 81) 5,939 (Increase 8) 47,644 (Increase 79)
03-24-2012 28,586 (Increase 71) 5,931 (Increase 6) 47,565 (Increase 41)
03-23-2012 28,515 (Increase 79) 5,925 (Increase 9) 47,524 (Increase 66)
03-22-2012 28,436 (Increase 92) 5,916 (Increase 6) 47,458 (Increase 88)
03-21-2012 28,344 (Increase 73) 5,910 (Increase 8) 47,370 (Increase 80)
03-12-2012 28,271 (Increase 22) 5,902 (Increase 7) 47,290 (Increase 27)
03-11-2012 28,249 (Increase 64) 5,895 (Increase 7) 47,263 (Increase 73)
03-10-2012 28,185 (Increase 53) 5,888 (Increase 5) 47,190 (Increase 74)
03-09-2012 28,132 (Increase 77) 5,883 (Increase 10) 47,116 (Increase 99)
03-08-2012 28,055 (Increase 67) 5,873 (Increase 8) 47,017 (Increase 118)
03-07-2012 27,988 (Increase 58) 5,865 (Increase 18) 46,899 (Increase 120)
03-06-2012 27,930 (Increase 86) 5,847 (Increase 15) 46,779 (Increase 103)
03-05-2012 27,844 (Increase 72) 5,832 (Increase 10) 46,676 (Increase 120)
03-04-2012 27,772 (Increase 88) 5,822 (Increase 6) 46,556 (Increase 93)
03-03-2012 27,684 (Increase 61) 5,816 (Increase 10) 46,463 (Increase 78)
03-02-2012 27,623 (Increase 64) 5,806 (Increase 8) 46,385 (Increase 95)
03-01-2012 27,559 (Increase 71) 5,798 (Increase 11) 46,290 (Increase 113)
02-29-2012 27,488 (Increase 80) 5,787 (Increase 6) 46,177 (Increase 136)
02-28-2012 27,408 (Increase 90) 5,781 (Increase 8) 46,041 (Increase 83)
No on your site as admin you should see "advanced statistics" such as this:

Generated in 0.1920421 seconds (48.51% PHP / 51.49% MySQL)
SQL Queries: 23 / Global Parsing Time: 0.0474050 / Memory Usage: 6.5 MB
PHP version: 7.0 / Server Load: 5.2759 / GZip Compression: Enabled

That's in footer of each page your visit on your forum front end.
thanks labroca, now i have seen. I have verified only forums:

forum1
Generated in 0.1590619 seconds (80.26% PHP / 19.74% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0783260 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.5249 / GZip Compression: Disabled


forum2
Generated in 0.2997921 seconds (41.70% PHP / 58.30% MySQL)
SQL Queries: 59 / Global Parsing Time: 0.2336581 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.6426 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.


forum3
Generated in 0.2563739 seconds (76.52% PHP / 23.48% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.1599400 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.6426 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.

forum4
Generated in 0.2940850 seconds (65.05% PHP / 34.95% MySQL)
SQL Queries: 147 / Global Parsing Time: 0.1918621 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.6426 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.

forum5
Generated in 0.1354499 seconds (79.54% PHP / 20.46% MySQL)
SQL Queries: 59 / Global Parsing Time: 0.0719681 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.3828 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.

forum6
Generated in 0.1169381 seconds (90.45% PHP / 9.55% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0718870 / Memory Usage: 29 MB
PHP version: 5.2.17 / Server Load: 0.3828 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.



forum7
Generated in 0.1700909 seconds (84.52% PHP / 15.48% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0860240 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.3828 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.

forum8
Generated in 0.1331089 seconds (79.82% PHP / 20.18% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0716898 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.7524 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.


forum9
Generated in 0.1628890 seconds (86.08% PHP / 13.92% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0817780 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.7524 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.


forum10
Generated in 0.1193271 seconds (87.19% PHP / 12.81% MySQL)
SQL Queries: 60 / Global Parsing Time: 0.0718541 / Memory Usage: 29.75 MB
PHP version: 5.2.17 / Server Load: 0.7524 / GZip Compression: Disabled
[advanced details]
Powered By MyBB, © 2002-2012 MyBB Group.





Find /etc/my.cnf
With an 8GB server you should be giving 60, 70, 80MB (or more!) to the main MySQL caches
(ie.
key_buffer=84M
tmp_table_size=80M
max_heap_table_size=76M
myisam_sort_buffer_size=80M
)


#
Look at '/etc/httpd/conf ' and (maybe) reduce the
ServerLimit
and
MaxClients
(the exact numbers take 'trial and error', too low will increase CPU load)

#
also,
Memory Usage: 29.75 MB == Way too high
APC php caching should reduce that somewhat.
they laughing to me but similiar thing you can see here
http://community.mybb.com/thread-115185.html
after my host block google bot to visit all my pages everything now its ok
also bad plugin for 1.6.6. caused this

[Image: ScreenShot093.png]
(2012-03-27, 09:09 AM)seeker Wrote: [ -> ]Look at '/etc/httpd/conf ' and (maybe) reduce the
ServerLimit
and
MaxClients
(the exact numbers take 'trial and error', too low will increase CPU load)

#
also,
Memory Usage: 29.75 MB == Way too high
APC php caching should reduce that somewhat.

Hello and thanks for answering.
I know exactly what you`re talking about. Before moving my board to the dedicated box i have hosted it on a VPS who has no variable seted up for max_user_connections. However since the hosting company dind't use this by default, it was probably added because my datebase gets a ton of mysql access. Since the VPS was constantly running out of memory, mostly from mysql usage, I suspect that was put there to try and help.
They removed the max_user_connections in mysql, and it was only going to help contribute to the maxing of memory usage on the VPS.
My board hosted to ex VPS constantly returning in browser the "already has more than 'max_user_connections' active connections [x]" error.
It is very hard to decide if this option is decent or not.
You need a managed VPS with a capable host. That or start reading. Your problems are not MyBB. They are at the server level. Your server needs to be properly configured and optimized.