Skip to main content

vBulletin + MySQL + cPanel / WHM dedicated server optimization request

Comments

8 comments

  • thinkbot
    can you run mysqltuner.pl ?
    0
  • forofutbolistas
    [quote="thinkbot, post: 1604362">can you run mysqltuner.pl ?
    Yes, of course :) >> MySQLTuner 1.2.0_1 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.5.36-cll [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM -------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 1G (Tables: 225) [--] Data in InnoDB tables: 928K (Tables: 58) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [--] Data in MEMORY tables: 2M (Tables: 2) [!!] Total fragmented tables: 19 -------- Performance Metrics ------------------------------------------------- [--] Up for: 1d 12h 43m 14s (10M q [81.262 qps], 710K conn, TX: 149B, RX: 3B) [--] Reads / Writes: 71% / 29% [--] Total buffers: 1.8G global + 12.3M per thread (1000 max threads) [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability [!!] Maximum possible memory usage: 13.8G (348% of installed RAM) [OK] Slow queries: 0% (5K/10M) [OK] Highest usage of available connections: 12% (121/1000) [OK] Key buffer size / total MyISAM indexes: 1.5G/718.8M [OK] Key buffer hit rate: 100.0% (474M cached / 234K reads) [OK] Query cache efficiency: 45.9% (3M cached / 7M selects) [!!] Query cache prunes per day: 14468 [OK] Sorts requiring temporary tables: 0% (386 temp sorts / 1M sorts) [OK] Temporary tables created on disk: 11% (4K on disk / 42K total) [OK] Thread cache hit rate: 96% (26K created / 710K connections) [OK] Table cache hit rate: 88% (1K open / 1K opened) [OK] Open file limit used: 2% (1K/61K) [OK] Table locks acquired immediately: 99% (11M immediate / 11M locks) [OK] InnoDB data size / buffer pool: 928.0K/128.0M -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance Enable the slow query log to troubleshoot bad queries Variables to adjust: *** MySQL's maximum memory usage is dangerously high *** *** Add RAM before increasing MySQL buffer variables *** query_cache_size (> 128M)
    I have optimized tables and the only use for the server is vBulletin + MySQL so I guess there should be no problems with high memory usage.
    0
  • thinkbot
    Hey, Your settings are way too high [--] Total buffers: 1.8G global + 12.3M per thread (1000 max threads) [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability [!!] Maximum possible memory usage: 13.8G (348% of installed RAM) you seem to have 4GB server, but have only 32-bit mysql installed, anyways update the config to: [client] #password = your_password port = 3306 socket = /var/lib/mysql/mysql.sock # The MySQL server [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock skip-external-locking skip-name-resolve tmpdir=/dev/shm key_buffer_size = 1200M max_allowed_packet = 1M table_open_cache = 1000 sort_buffer_size = 256K read_buffer_size = 128K read_rnd_buffer_size = 256K myisam_sort_buffer_size = 128M thread_cache_size = 16 query_cache_size = 75M open_files_limit = 32768 max_connections = 150 innodb_buffer_pool_size = 20M #skip-networking server-id = 1 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 384M sort_buffer_size = 384M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout
    and apache ------------------------------- From /usr/local/apache/conf/httpd.conf ------------------------------- Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 1 StartServers 10 MinSpareServers 5 MaxSpareServers 10 MinSpareServers 5 MaxSpareServers 10 ServerLimit 200
    and make sure you have php opcode installed like eaccelerator or APC
    0
  • forofutbolistas
    [quote="thinkbot, post: 1604541">Hey, Your settings are way too high [--] Total buffers: 1.8G global + 12.3M per thread (1000 max threads) [!!] Allocating > 2GB RAM on 32-bit systems can cause system instability [!!] Maximum possible memory usage: 13.8G (348% of installed RAM) you seem to have 4GB server, but have only 32-bit mysql installed, and make sure you have php opcode installed like eaccelerator or APC
    Thanks a lot for the advice. I have just updated my.cnf and httpd.conf, and restarted MySQL / Apache. mysqltuner.pl is showing some improvements :) >> MySQLTuner 1.2.0_1 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.5.36-cll [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM -------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 1G (Tables: 225) [--] Data in InnoDB tables: 928K (Tables: 58) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [--] Data in MEMORY tables: 633K (Tables: 2) [!!] Total fragmented tables: 20 -------- Performance Metrics ------------------------------------------------- [--] Up for: 4h 2m 30s (1M q [83.784 qps], 84K conn, TX: 18B, RX: 404M) [--] Reads / Writes: 72% / 28% [--] Total buffers: 1.3G global + 960.0K per thread (150 max threads) [OK] Maximum possible memory usage: 1.4G (36% of installed RAM) [OK] Slow queries: 0% (415/1M) [OK] Highest usage of available connections: 28% (43/150) [OK] Key buffer size / total MyISAM indexes: 1.2G/721.8M [OK] Key buffer hit rate: 99.8% (60M cached / 109K reads) [OK] Query cache efficiency: 47.4% (380K cached / 802K selects) [OK] Query cache prunes per day: 0 [OK] Sorts requiring temporary tables: 0% (263 temp sorts / 192K sorts) [OK] Temporary tables created on disk: 8% (468 on disk / 5K total) [OK] Thread cache hit rate: 99% (458 created / 84K connections) [OK] Table cache hit rate: 98% (568 open / 575 opened) [OK] Open file limit used: 2% (716/32K) [OK] Table locks acquired immediately: 99% (1M immediate / 1M locks) [OK] InnoDB data size / buffer pool: 928.0K/20.0M -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Enable the slow query log to troubleshoot bad queries
    I am using Xcache 3.0.3 as compiled with EasyApache, I have found it easier to implent than APC or eaccelerator. I'll wait 24 hours in order to check if it shows improvement on the forum's busiest hours. Thanks again :)
    0
  • cPanelMichael
    [quote="forofutbolistas, post: 1604802">I'll wait 24 hours in order to check if it shows improvement on the forum's busiest hours.
    I am happy to see the community here was able to provide you with some advice. Did you notice any improvement during those busy hours? Thank you.
    0
  • forofutbolistas
    [quote="cPanelMichael, post: 1608482">I am happy to see the community here was able to provide you with some advice. Did you notice any improvement during those busy hours? Thank you.
    Yes, one week after the new values in my.cnf and httpd.conf were applied the server is working much more lag-free during the nightly busiest hours. It bothers me a bit that it's only using around 25% of the 4 GB of RAM installed but I guess it may be due to CentOS 5.10 being a 32bit OS in my server. I'm very thankful for the help so promptly and profesionally offered. :)
    0
  • forofutbolistas
    Hello again :o Yesterday night the same problems arose and high server load appeared just like before applying the optimization advice: root@server [~]# nice top -c top - 15:35:56 up 41 days, 29 min, 1 user, load average: 31.00, 31.29, 31.52 Tasks: 247 total, 2 running, 244 sleeping, 0 stopped, 1 zombie Cpu(s): 59.0%us, 2.8%sy, 0.1%ni, 37.3%id, 0.2%wa, 0.0%hi, 0.5%si, 0.0%st Mem: 4151412k total, 3821052k used, 330360k free, 108980k buffers Swap: 4192956k total, 80k used, 4192876k free, 2286540k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 29631 mysql 15 0 1596m 657m 5540 S 163.9 16.2 22534:30 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql - 16387 nobody 15 0 73268 16m 7852 S 9.1 0.4 0:02.27 /usr/local/apache/bin/httpd -k start -DSSL 16155 nobody 15 0 72560 15m 7740 S 5.5 0.4 0:02.97 /usr/local/apache/bin/httpd -k start -DSSL 16367 nobody 15 0 72196 14m 7240 S 5.5 0.4 0:02.67 /usr/local/apache/bin/httpd -k start -DSSL 18969 nobody 15 0 72872 14m 6496 S 5.5 0.4 0:00.40 /usr/local/apache/bin/httpd -k start -DSSL 15813 nobody 15 0 73164 16m 7844 S 4.9 0.4 0:06.52 /usr/local/apache/bin/httpd -k start -DSSL 8249 nobody 15 0 73728 17m 8792 S 4.2 0.4 0:12.16 /usr/local/apache/bin/httpd -k start -DSSL 18925 nobody 15 0 74280 16m 6676 S 3.9 0.4 0:01.37 /usr/local/apache/bin/httpd -k start -DSSL 18932 nobody 15 0 73292 17m 8664 S 3.9 0.4 0:01.09 /usr/local/apache/bin/httpd -k start -DSSL 16241 nobody 15 0 72844 15m 6932 S 3.6 0.4 0:01.85 /usr/local/apache/bin/httpd -k start -DSSL 19162 nobody 15 0 71472 15m 6296 S 3.6 0.4 0:00.18 /usr/local/apache/bin/httpd -k start -DSSL 18775 nobody 15 0 73108 15m 6952 S 1.8 0.4 0:01.54 /usr/local/apache/bin/httpd -k start -DSSL 15730 nobody 16 0 74208 16m 7076 S 1.5 0.4 0:02.05 /usr/local/apache/bin/httpd -k start -DSSL 18982 nobody 16 0 74100 15m 6884 S 1.2 0.4 0:00.48 /usr/local/apache/bin/httpd -k start -DSSL 18781 nobody 16 0 73116 15m 7360 S 0.9 0.4 0:01.50 /usr/local/apache/bin/httpd -k start -DSSL 18918 nobody 15 0 73680 15m 6652 S 0.9 0.4 0:01.01 /usr/local/apache/bin/httpd -k start -DSSL 19101 root 26 10 2556 1224 832 R 0.9 0.0 0:00.21 top -c 9647 nobody 15 0 73996 17m 8140 S 0.6 0.4 0:13.26 /usr/local/apache/bin/httpd -k start -DSSL 16277 nobody 15 0 72784 17m 9332 S 0.6 0.4 0:02.61 /usr/local/apache/bin/httpd -k start -DSSL 19027 nobody 15 0 73436 15m 6980 S 0.6 0.4 0:00.51 /usr/local/apache/bin/httpd -k start -DSSL 15694 nobody 15 0 72836 17m 9152 S 0.3 0.4 0:04.31 /usr/local/apache/bin/httpd -k start -DSSL 15698 nobody 15 0 72548 15m 7704 S 0.3 0.4 0:03.30 /usr/local/apache/bin/httpd -k start -DSSL 15787 nobody 15 0 72844 15m 7432 S 0.3 0.4 0:03.84 /usr/local/apache/bin/httpd -k start -DSSL 15788 nobody 15 0 73144 15m 7288 S 0.3 0.4 0:06.77 /usr/local/apache/bin/httpd -k start -DSSL 15805 nobody 15 0 72588 17m 9212 S 0.3 0.4 0:04.58 /usr/local/apache/bin/httpd -k start -DSSL 16165 nobody 15 0 72180 14m 7092 S 0.3 0.4 0:04.59 /usr/local/apache/bin/httpd -k start -DSSL 16176 nobody 15 0 0 0 0 Z 0.3 0.0 0:04.59 [httpd] 16349 nobody 15 0 73452 16m 8212 S 0.3 0.4 0:05.13 /usr/local/apache/bin/httpd -k start -DSSL 16390 nobody 15 0 73276 15m 7232 S 0.3 0.4 0:02.78 /usr/local/apache/bin/httpd -k start -DSSL 16392 nobody 15 0 73052 18m 9.8m S 0.3 0.5 0:02.72 /usr/local/apache/bin/httpd -k start -DSSL 18608 nobody 15 0 72896 15m 7496 S 0.3 0.4 0:02.25 /usr/local/apache/bin/httpd -k start -DSSL 18686 nobody 15 0 72940 15m 7068 S 0.3 0.4 0:01.85 /usr/local/apache/bin/httpd -k start -DSSL 18916 nobody 15 0 73116 15m 7248 S 0.3 0.4 0:01.19 /usr/local/apache/bin/httpd -k start -DSSL 1 root 15 0 2176 640 556 S 0.0 0.0 0:14.23 init [3] 2 root RT -5 0 0 0 S 0.0 0.0 0:09.94 [migration/0] 3 root 34 19 0 0 0 S 0.0 0.0 0:00.19 [ksoftirqd/0] 4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 [watchdog/0] root@server [~]# mysqladmin processlist +---------+-----------------+-----------+-----------------+---------+------+--------------+-------------------------------------------------------------------------------------+ | Id | User | Host | db | Command | Time | State | Info | +---------+-----------------+-----------+-----------------+---------+------+--------------+-------------------------------------------------------------------------------------+ | 5260187 | forum_user1 | localhost | forum_database1 | Query | 0 | Sending data | SELECT COUNT(*) AS total FROM post_thanks WHERE userid = 8263 AND date > 1396737364 | | 5260195 | forum_user1 | localhost | forum_database1 | Sleep | 0 | | | | 5260196 | root | localhost | | Query | 0 | | show processlist | +---------+-----------------+-----------+-----------------+---------+------+--------------+-------------------------------------------------------------------------------------+
    >> MySQLTuner 1.2.0_1 - Major Hayden >> Bug reports, feature requests, and downloads at http://mysqltuner.com/ >> Run with '--help' for additional options and output filtering -------- General Statistics -------------------------------------------------- [--] Skipped version check for MySQLTuner script [OK] Currently running supported MySQL version 5.5.36-cll [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM -------- Storage Engine Statistics ------------------------------------------- [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 1G (Tables: 225) [--] Data in InnoDB tables: 928K (Tables: 58) [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17) [--] Data in MEMORY tables: 760K (Tables: 2) [!!] Total fragmented tables: 23 -------- Performance Metrics ------------------------------------------------- [--] Up for: 9h 43m 57s (2M q [84.865 qps], 200K conn, TX: 43B, RX: 946M) [--] Reads / Writes: 74% / 26% [--] Total buffers: 1.3G global + 960.0K per thread (150 max threads) [OK] Maximum possible memory usage: 1.5G (36% of installed RAM) [OK] Slow queries: 0% (1K/2M) [OK] Highest usage of available connections: 57% (86/150) [OK] Key buffer size / total MyISAM indexes: 1.2G/756.1M [OK] Key buffer hit rate: 99.9% (135M cached / 145K reads) [OK] Query cache efficiency: 45.7% (917K cached / 2M selects) [!!] Query cache prunes per day: 33944 [OK] Sorts requiring temporary tables: 0% (2K temp sorts / 456K sorts) [OK] Temporary tables created on disk: 9% (984 on disk / 10K total) [OK] Thread cache hit rate: 99% (1K created / 200K connections) [OK] Table cache hit rate: 94% (783 open / 828 opened) [OK] Open file limit used: 2% (886/32K) [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks) [OK] InnoDB data size / buffer pool: 928.0K/20.0M -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance MySQL started within last 24 hours - recommendations may be inaccurate Enable the slow query log to troubleshoot bad queries Variables to adjust: query_cache_size (> 100M)
    Is there any other optimization I may apply in order to improve those high server loads? :(
    0
  • thinkbot
    track slow queries in your mysql my.cnf slow_query_log=1 slow_query_log_file=mysql-slow.log long_query_time=0.1 let it run for some time then review them cd /root/ wget
    0

Please sign in to leave a comment.