MyBB Community Forums

Full Version: High CPU Usage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Hi!

I have a preformance issue with myBB. My db is a huge one, (~900MB) and it eats a lot of CPU. +There's 300k monthly unique visitors. I tried to tweak mysql , but i'm a newbie "webmaster", so i have a limit.

I really don't know what can i do now.

Any suggestions will be appreciated.
well this depends on ur webhost. you could try and intergrate cloudflare with your site its a CDN(content dilvery network) or you could use MAXCDN Helps to save bandwith and speed ur site up.

maxcdn intergation: YOU NEED TO PAY FOR MAX CDN
http://community.mybb.com/thread-94678.html

CloudFlare is free or you can go pro

Sites:
Cloudflare: www.cloudflare.com/

MaxCDN: www.maxcdn.com/

- srry bad english.
What are your debug stats like? These are the stats shown to admins at the bottom of the page, you might have to enable them if they are not already visible.

Are you running any plugins that might be resource intensive? A list of your plugins would help.

Are you on a shared hosting or is the site on a vps/dedicated?
The time is now 3:33 AM here, so the load is OK now:
Generated in 0.1581059 seconds (43.57% PHP / 56.43% MySQL)
SQL Queries: 14 / Global Parsing Time: 0.0736508 / Memory Usage: 4.5 MB
PHP version: 5.2.17 / Server Load: 0.46 / GZip Compression: Enabled

Installed Plugins:
Fit on Page
Google SEO
PostAd

Hosting: A VPS with 4 usable cpu cores, (2,4ghz) 2/4 Gb Ram.
So when does it get bad? How bad does the cpu load get for you to consider it a problem?

When its gets bad could you monitor the server to see what service is that is causing the cpu load? You might be thinking its sql when it couls be something else.

One thing that you could check and do is to move any maintenance crons/tasks on the server to a time when the site is slower (less traffic). Check the crons for the services running and their times.

Consider joining the Big-Board group where we have some extra discussions for large MyBB forum sites.

Other than you telling us you have a large DB there isn't a lot to discern from that information. The DB size and MySQL could be the cause. You'd have to review things while CPU is high. Such as actual bandwidth usage, apache logs, and mysql processes.

I'm so sorry for the delay.

I'll post some info about processes and logs when my forum become overloaded again.

Other interesting thing, my VPS doesn't eat too much memory. 350MB max!!
Maybe there's some limitations for memory saving.

Now i try to tweak /etc/my.cnf

My current settings:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections = 600
key_buffer = 16M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1000
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 16M
query_cache_type = 1
tmp_table_size = 16M
skip-innodb
skip-bdb
user=mysql
local-infile=0
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit = 8192

[isamchk]
key_buffer = 32M
sort_buffer = 32M
read_buffer = 16M
write_buffer = 16M

[myisamchk]
key_buffer = 32M
sort_buffer = 32M
read_buffer = 16M
write_buffer = 16M
[mysqlhotcopy]
interactive-timeout

skip-networking

#log-slow-queries = /var/log/mysql-slow.log


Processes (using top command):

 1781 mysql     15   0 76364  51m 5376 S 110.3  1.2 874:46.09 mysqld
13916 xxxx    15   0 29016  14m 6360 S  3.7  0.4   0:00.11 php-cgi
13918 xxxx    17   0 29020  14m 6352 S  3.0  0.4   0:00.09 php-cgi
13909 xxxx    15   0 29788  15m 6420 S  0.7  0.4   0:00.12 php-cgi
    1 root      15   0  2156  656  568 S  0.0  0.0   0:02.71 init
 1050 root      15   0 12260 4984 2632 S  0.0  0.1   0:01.87 httpd
 1659 root      18   0  3712 1268 1108 S  0.0  0.0   0:00.00 sh
 1732 root      23   0  3708 1304 1132 S  0.0  0.0   0:00.00 mysqld_safe
 1782 root      21   0  2904  648  564 S  0.0  0.0   0:00.00 logger
 1820 root      18   0  7060 1568 1168 S  0.0  0.0   0:00.01 authdaemond
 1826 root      15   0  1780  380  316 S  0.0  0.0   0:00.04 tcpserver
 1829 root      22   0  1780  372  312 S  0.0  0.0   0:00.00 tcpserver
 1832 root      15   0  1780  376  316 S  0.0  0.0   0:00.03 tcpserver
 1840 root      18   0  1780  372  312 S  0.0  0.0   0:00.00 tcpserver
 1853 root      15   0  4500 1104  560 S  0.0  0.0   0:00.22 crond
 1865 root      15   0 26188  14m 4172 S  0.0  0.4   0:00.63 php
Are you running any other software on your server?
Yes, but just a new site, without any visitors.
You need more ram and resources for your site.
Pages: 1 2 3 4 5 6 7