Jump to content

Server Upgrade now need settings help.


Recommended Posts

Hi,

Please can you help me with server settings.

I have upgrade MYSQL & Appache and swapped server plan for 2gb ram and improved server.

I installed sphinx but that stopped working when I went to myswl 5.1 so need to look into that again.

Need to run MySqltuneup but only just moved to new Hybrid VPS.

Here are my stats...


IP.Board Version =v3.2.3
Total Members = 12,538
Topics = 23,576
Posts = 648,902
Average users online = 250 to 300
MYSQL Version = MYSQL 5.1.61
MYSQL size = 1.7GB
Total Server Memory = 2240 MB
Server version: Apache/2.2.22 (Unix)



[mysqld]
skip-innodb
set-variable = max_connections=500
safe-show-database
max_tmp_tables=1
query_cache_type=1
query_cache_limit=2M
query_cache_size=64M
table_cache=256
thread_cache_size=4




/etc/httpd/conf/httpd.conf
# These can be set in WHM under 'Apache Global Configuration'
Timeout 300
TraceEnable On
ServerSignature Off
ServerTokens Full
FileETag All
StartServers 5
<IfModule prefork.c>
MinSpareServers 5
MaxSpareServers 10
</IfModule>
ServerLimit 256
MaxClients 150
MaxRequestsPerChild 10000
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 100

Link to comment
Share on other sites


[font=helvetica, arial, sans-serif][color=#282828]Manually[/color][/font][color=#282828][font=helvetica, arial, sans-serif] Optimize all tables ( Turned of in cron /ipb as did wonder it that was killing the server)[/font][/color]




What cron was killing the server?
Link to comment
Share on other sites

MysqlTuner.




-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.61
[!!] 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: 919M (Tables: 355)
[!!] Total fragmented tables: 34

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 9h 24m 36s (2M q [19.519 qps], 132K conn, TX: 56B, RX: 807M)
[--] Reads / Writes: 55% / 45%
[--] Total buffers: 88.0M global + 2.7M per thread (500 max threads)
[OK] Maximum possible memory usage: 1.4G (63% of installed RAM)
[OK] Slow queries: 0% (976/2M)
[OK] Highest usage of available connections: 30% (152/500)
[OK] Key buffer size / total MyISAM indexes: 8.0M/476.7M
[OK] Key buffer hit rate: 98.7% (213M cached / 2M reads)
[OK] Query cache efficiency: 42.3% (599K cached / 1M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (1 temp sorts / 5K sorts)
[!!] Temporary tables created on disk: 37% (2K on disk / 6K total)
[OK] Thread cache hit rate: 89% (14K created / 132K connections)
[!!] Table cache hit rate: 2% (513 open / 19K opened)
[OK] Open file limit used: 12% (527/4K)
[OK] Table locks acquired immediately: 97% (2M immediate / 2M locks)

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Enable the slow query log to troubleshoot bad queries
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
table_cache (> 512)



System Processes

top - 17:24:07 up 2 days, 11:06, 1 user, load average: 2.93, 4.00, 3.63
Tasks: 138 total, 5 running, 133 sleeping, 0 stopped, 0 zombie
Cpu(s): 2.2%us, 0.3%sy, 0.0%ni, 93.4%id, 4.1%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2293760k total, 1005252k used, 1288508k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32104 nobody 15 0 40176 25m 3224 S 75.5 1.1 0:01.47 httpd
32031 nobody 16 0 39480 25m 3212 S 71.6 1.1 0:01.26 httpd
30686 nobody 16 0 38224 24m 3232 R 50.3 1.1 0:02.10 httpd
32048 nobody 16 0 38196 24m 3220 R 46.4 1.1 0:00.84 httpd
32073 nobody 15 0 33516 19m 3216 R 36.8 0.9 0:00.93 httpd
29829 nobody 15 0 39504 25m 3264 S 31.0 1.1 0:04.12 httpd
32074 nobody 16 0 27708 14m 3220 S 27.1 0.6 0:01.14 httpd
30698 nobody 15 0 30392 17m 3824 S 23.2 0.8 0:02.45 httpd
32231 nobody 15 0 28540 14m 3196 S 23.2 0.7 0:00.39 httpd
14203 mysql 15 0 151m 84m 4660 S 19.3 3.8 67:31.79 mysqld
32013 nobody 15 0 37616 23m 3220 S 19.3 1.1 0:01.10 httpd
32011 nobody 15 0 38376 24m 3224 S 17.4 1.1 0:01.47 httpd
32266 nobody 16 0 27496 13m 3120 S 17.4 0.6 0:00.20 httpd
32237 nobody 15 0 31964 18m 3192 S 13.5 0.8 0:00.31 httpd
32077 nobody 16 0 29092 15m 3208 S 11.6 0.7 0:01.73 httpd
32068 nobody 15 0 38628 24m 3220 S 9.7 1.1 0:01.12 httpd
30450 nobody 15 0 29092 15m 3224 S 5.8 0.7 0:03.17 httpd
30689 nobody 15 0 31728 18m 3224 S 5.8 0.8 0:00.79 httpd
30691 nobody 16 0 29640 16m 3260 S 5.8 0.7 0:01.90 httpd
30696 nobody 16 0 29060 15m 3224 S 5.8 0.7 0:02.71 httpd
30708 nobody 16 0 30852 17m 3228 S 5.8 0.8 0:02.95 httpd
31840 nobody 16 0 31208 17m 3220 S 5.8 0.8 0:02.31 httpd
32018 nobody 16 0 31316 17m 3220 S 5.8 0.8 0:00.67 httpd
32051 nobody 15 0 29056 15m 3260 S 5.8 0.7 0:01.44 httpd
32060 nobody 16 0 29080 15m 3224 S 5.8 0.7 0:01.11 httpd
32093 nobody 16 0 36928 23m 3220 S 5.8 1.0 0:00.65 httpd
32232 nobody 15 0 31712 18m 3204 S 5.8 0.8 0:00.28 httpd
32235 nobody 16 0 31712 18m 3204 S 5.8 0.8 0:00.34 httpd
32274 nobody 15 0 28884 15m 3820 R 5.8 0.7 0:00.13 httpd
32275 nobody 15 0 36844 22m 3160 S 5.8 1.0 0:00.30 httpd
29845 nobody 15 0 31728 18m 3220 S 3.9 0.8 0:02.38 httpd
31868 nobody 16 0 31156 17m 3260 S 3.9 0.8 0:02.56 httpd
32043 nobody 15 0 31728 18m 3220 S 3.9 0.8 0:00.94 httpd
32047 nobody 15 0 35808 21m 3208 S 3.9 1.0 0:00.64 httpd
32052 nobody 15 0 29668 16m 3220 S 3.9 0.7 0:00.56 httpd
32070 nobody 16 0 31728 18m 3224 S 3.9 0.8 0:00.67 httpd
32081 nobody 15 0 32252 18m 3212 S 3.9 0.8 0:01.31 httpd
32099 nobody 15 0 29080 15m 3220 S 3.9 0.7 0:01.10 httpd
32238 nobody 15 0 31200 17m 3184 S 3.9 0.8 0:00.30 httpd
32254 nobody 16 0 30888 17m 3184 S 3.9 0.8 0:00.27 httpd
32273 nobody 16 0 31712 18m 3200 S 3.9 0.8 0:00.30 httpd
31909 nobody 15 0 38200 24m 3268 S 1.9 1.1 0:02.11 httpd
32027 nobody 16 0 31712 18m 3220 S 1.9 0.8 0:01.00 httpd
32053 nobody 15 0 31728 18m 3220 S 1.9 0.8 0:00.94 httpd
32079 nobody 15 0 36824 23m 3820 S 1.9 1.0 0:01.07 httpd
32086 nobody 15 0 38148 24m 3232 S 1.9 1.1 0:00.60 httpd
32268 nobody 16 0 38144 23m 3156 S 1.9 1.1 0:00.29 httpd
32269 nobody 16 0 31200 17m 3184 S 1.9 0.8 0:00.27 httpd
32288 nobody 15 0 2416 1000 732 R 1.9 0.0 0:00.01 top
1 root 18 0 2156 664 576 S 0.0 0.0 0:04.25 init
1143 root 16 -4 2260 544 328 S 0.0 0.0 0:00.00 udevd
1573 root 15 0 1812 564 476 S 0.0 0.0 0:00.88 syslogd
1576 root 15 0 1760 408 336 S 0.0 0.0 0:00.02 klogd
1600 named 18 0 191m 5240 2080 S 0.0 0.2 0:06.12 named
1628 root 18 0 1744 420 352 S 0.0 0.0 0:00.00 courierlogger
1629 root 18 0 2088 628 516 S 0.0 0.0 0:00.03 authdaemond
1636 root 18 0 2088 364 248 S 0.0 0.0 0:00.05 authdaemond
1637 root 15 0 2088 364 248 S 0.0 0.0 0:00.04 authdaemond
1648 root 18 0 7240 1040 636 S 0.0 0.0 0:00.01 sshd
1765 root 17 0 1744 336 276 S 0.0 0.0 0:00.00 courierlogger
1766 root 18 0 1856 540 444 S 0.0 0.0 0:00.00 couriertcpd
1772 root 21 0 1744 336 276 S 0.0 0.0 0:00.00 courierlogger
1773 root 18 0 1856 544 444 S 0.0 0.0 0:00.00 couriertcpd
1778 root 16 0 1744 420 352 S 0.0 0.0 0:00.01 courierlogger
1779 root 15 0 1856 560 464 S 0.0 0.0 0:00.03 couriertcpd
1784 root 24 0 1744 332 276 S 0.0 0.0 0:00.00 courierlogger
1785 root 25 0 1856 544 444 S 0.0 0.0 0:00.00 couriertcpd
3310 mailnull 15 0 10368 2664 2176 S 0.0 0.1 0:00.06 exim
3339 root 18 0 34100 30m 2276 S 0.0 1.3 0:08.50 spamd
3368 root 18 0 8652 5496 2052 S 0.0 0.2 0:00.08 leechprotect
3374 root 17 0 24632 9656 1272 S 0.0 0.4 0:00.00 httpd
3389 root 15 0 34100 28m 1024 S 0.0 1.3 0:00.01 spamd
3401 root 18 0 5384 1448 1100 S 0.0 0.1 0:00.00 pure-ftpd
3403 root 16 0 5080 1152 904 S 0.0 0.1 0:00.01 pure-authd
3414 root 18 0 3332 1112 568 S 0.0 0.0 0:00.63 crond
3522 root 18 0 15432 9264 1780 S 0.0 0.4 0:00.01 cpdavd
3547 root 18 0 14380 7780 1596 S 0.0 0.3 0:05.15 cpsrvd-ssl
3553 root 15 0 6096 4316 1320 S 0.0 0.2 0:00.58 queueprocd
3564 root 34 18 4216 2196 964 S 0.0 0.1 0:06.10 cpanellogd
3585 root 22 0 5684 716 436 S 0.0 0.0 0:00.00 saslauthd
3586 root 22 0 5684 444 164 S 0.0 0.0 0:00.00 saslauthd
3794 root 18 0 1768 416 336 S 0.0 0.0 0:00.00 portsentry
4078 root 18 0 4664 2836 1528 S 0.0 0.1 0:00.36 authProg
7669 root 15 0 4664 2840 1528 S 0.0 0.1 0:00.35 authProg
9418 root 18 0 16512 14m 1356 S 0.0 0.6 0:11.98 lfd
14121 root 21 0 2500 1100 936 S 0.0 0.0 0:00.01 mysqld_safe
17470 root 15 0 8656 5484 1968 S 0.0 0.2 0:20.92 tailwatchd
26513 root 18 0 24632 12m 4852 S 0.0 0.6 1:08.34 httpd
28182 nobody 16 0 39008 25m 3264 S 0.0 1.1 0:04.17 httpd
28453 nobody 15 0 34744 20m 3204 S 0.0 0.9 0:00.64 httpd
28546 nobody 16 0 31216 17m 3224 S 0.0 0.8 0:04.19 httpd
28550 nobody 16 0 29088 15m 3224 S 0.0 0.7 0:03.70 httpd
29850 nobody 15 0 30960 17m 3224 S 0.0 0.8 0:02.46 httpd
30348 root 15 0 10104 3296 2728 S 0.0 0.1 0:00.06 sshd
30396 root 16 0 3092 1392 1084 S 0.0 0.1 0:00.00 login
30400 root 18 0 2684 1384 1112 S 0.0 0.1 0:00.01 bash
30425 nobody 16 0 31656 18m 3224 S 0.0 0.8 0:03.16 httpd
30502 root 16 0 2420 1132 824 S 0.0 0.0 0:00.69 top
30511 nobody 15 0 38384 24m 3292 S 0.0 1.1 0:02.89 httpd
30515 nobody 17 0 38712 24m 3220 S 0.0 1.1 0:00.64 httpd
31850 nobody 16 0 31644 18m 3224 S 0.0 0.8 0:01.44 httpd
31887 nobody 16 0 32216 18m 3224 S 0.0 0.8 0:01.40 httpd
31903 nobody 18 0 32312 18m 3220 S 0.0 0.8 0:02.23 httpd
32021 nobody 18 0 28464 14m 3164 S 0.0 0.7 0:00.45 httpd
32029 nobody 15 0 31712 18m 3220 S 0.0 0.8 0:00.73 httpd
32042 nobody 17 0 32464 18m 3248 S 0.0 0.8 0:00.45 httpd
32058 nobody 18 0 30956 17m 3220 S 0.0 0.8 0:01.26 httpd
32065 nobody 15 0 27980 14m 3196 S 0.0 0.6 0:00.77 httpd
32071 nobody 15 0 31728 18m 3224 S 0.0 0.8 0:00.98 httpd
32083 nobody 16 0 31996 18m 3192 S 0.0 0.8 0:00.63 httpd
32088 nobody 15 0 31912 18m 3224 S 0.0 0.8 0:01.15 httpd
32091 nobody 15 0 31956 18m 3220 S 0.0 0.8 0:00.80 httpd
32100 nobody 15 0 29824 16m 3232 S 0.0 0.7 0:00.57 httpd
32230 nobody 16 0 31204 17m 3196 S 0.0 0.8 0:00.62 httpd
32241 nobody 16 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd
32243 nobody 15 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32245 nobody 15 0 24772 10m 2460 S 0.0 0.5 0:00.00 httpd
32246 nobody 15 0 24772 10m 2460 S 0.0 0.5 0:00.00 httpd
32247 nobody 15 0 24772 10m 2460 S 0.0 0.5 0:00.00 httpd
32248 nobody 16 0 29624 15m 3124 S 0.0 0.7 0:00.16 httpd
32249 nobody 15 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32250 nobody 16 0 24772 10m 2460 S 0.0 0.5 0:00.00 httpd
32252 nobody 15 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32253 nobody 18 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32255 nobody 15 0 25336 11m 2672 S 0.0 0.5 0:00.00 httpd
32256 nobody 17 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32257 nobody 17 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32258 nobody 15 0 24772 10m 2468 S 0.0 0.5 0:00.00 httpd
32259 nobody 18 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd
32262 nobody 18 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd
32263 nobody 20 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd
32264 nobody 20 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32265 nobody 20 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32267 nobody 19 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32270 nobody 15 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd
32271 nobody 15 0 31204 17m 3188 S 0.0 0.8 0:00.28 httpd
32276 nobody 15 0 24772 10m 2456 S 0.0 0.5 0:00.00 httpd
32277 nobody 16 0 24772 10m 2464 S 0.0 0.5 0:00.00 httpd

Link to comment
Share on other sites

New my.cnf


mysqld]
skip-innodb
set-variable = max_connections=500
safe-show-database
max_tmp_tables=1
query_cache_type=1
query_cache_limit=2M
query_cache_size=64M
table_cache=512
thread_cache_size=4
tmp_table_size=16M
max_heap_table_size=16M

Link to comment
Share on other sites

Apache Version Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.3.10 Apache API Version 20051115 User/Group nobody(99)/99 Max Requests Per Child: 10000 - Keep Alive: on - Max Per Connection: 100 Timeouts Connection: 300 - Keep-Alive: 5 Virtual Server Yes Server Root /usr/local/apache Loaded Modules core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_log_config mod_logio mod_env mod_expires mod_headers mod_setenvif mod_version mod_proxy mod_proxy_connect mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_ajp mod_proxy_balancer mod_ssl prefork http_core mod_mime mod_status mod_autoindex mod_asis mod_info mod_suexec mod_cgi mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_auth_passthrough mod_bwlimited mod_fpcgid mod_php5




So should do this below to help.... ?

From...

http://community.inv...e/#entry2210171

You'll need to ensure mod_expires is enabled then add this to the bottom of your httpd.conf file (backup the file first):

# Improve caching - Load images, css, and javascript from visitors
# browser for 30 days before re-caching

ExpiresActive on
ExpiresByType text/css "access plus 1 day"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/icon "access plus 1 month"

Obviously you can change the refresh timings to suit your site/setup, but this basically stores the files on the visitors browser and loads them from the local (computer) cache rather than from the server each time. Once the expires time is up, a new copy will be downloaded from the server and cached for whatever period you have set in httpd.conf.

Caveat - it has an occasional side effect that you need to be aware of; the visitor's browser can continue to use the cached data even when you've actually updated it on the server - particularly pesky when someone changes their avatar and the old one keeps appearing - but all it needs to "cure" it is a forced-refresh by the browser (to update all the cached files) and that sorts the problem out.


Credit CycleChat

Link to comment
Share on other sites

Here is my GUESS depending on the information you have provided.

Your system shows a highly disproportionate io wait to cpu actually working.
> Cpu(s): 2.2%us, 0.3%sy, 0.0%ni, 93.4%id, 4.1%wa, 0.0%hi, 0.0%si, 0.0%st
It's very likely that your vps's IO just plainly sucks and no means of tweaking mysql will likely help you much.

Things that will help you
1. Setting expiry settings on static files (like you mentioned above).
2. Moving to another host that doesn't crap out their disk.

On less relevant issue, you have more httpd children than you can handle which aren't even really doing anything other than hogging ram and small amounts of cpu.

=======================
Here is the stats you should post

iostat -x 60 2
This NEEDS to be run when your server is lagging.
and post the SECOND stat. (This will run for 1 minute) If you don't have iostat, it's under sysstat package.

OR

ioping -RL /path/to/disk
http://code.google.com/p/ioping/
This will just do tests on its own. Preferably during lagging time.

Either of these will show average io seek time.
If you get a high avg number, it's quite frankly unacceptable for a database. 200ms is very high for example.
Typically good if condition under 20ms.

Link to comment
Share on other sites


VPS = Glorified shared hosting! :smile: get a nice dedicated server to suit your needs and have full control! :smile:



As mentioned above if your io wait time is over 1.0% your waiting on the disk... waiting = slow



There ARE good vps'es out there. Bad ones shouldn't discredit all vpses in existence.
There are also vps out there with REAL dedicated resource too. Like 1 cpu core. ram without overselling, one physical drive, guaranteed bandwidth.
Link to comment
Share on other sites

Try this one:

key_buffer = 512M
key_buffer_size = 512M
skip-innodb
max_connections = 400
query_cache_type=1
query_cache_limit=3M
query_cache_size=128M
table_cache=1000
thread_cache_size=4
tmp_table_size=32M
max_heap_table_size=32M
connect_timeout = 30
wait_timeout = 90
interactive_timeout = 90
open_files_limit = 3000

Your key buffer seems to low from your mysqltuner output.

[OK] Key buffer size / total MyISAM indexes: 8.0M/476.7M



Increasing that will definately increase performance. Also your table cache is too poor. So increase that with open file limit will help too. There is nothing much you can do over temp tables since it will be always created.

Link to comment
Share on other sites

Thanks for all you help on this. It is looking like a dedicated server is the only solution but need to consider all the options before tacking that jump.

Will Archive the posts (new in 3.3.0) help with disk IO ?

That's if it is my forum with the disk I/O issues and not another vps customer using a lot of disk I/O

Would moving some table to InnoDB help ?

Added my forum url on to my profile.

Link to comment
Share on other sites

Unless you have some really really terrible mod installed on your IPB, I can guarantee that your disk is being abused by another customer and not you. It's impossible to get CPU usage ratios like that with IPB. IPB is actually fairly cpu intensive which would make a high user CPU usage (yours is 2.2%).

Per forum rules, I'm not allowed to solicit any hosting services, but if you don't want to pay for dedicated, I can suggest you in private some vps providers known for high quality if you want. There are also SSD VPSes out there which will likely out perform most low end dedi.

Link to comment
Share on other sites

By looking at those stats output, The mysqld is not the issue, If you look you have a lot of idle http connections so I can only assume your running DSO for your apache, If your unsure and want to clear them faster to free up memory and the CPU I would suggest you turn the keep_alive_timeout to ON and set timeout period to 2, ( Apache runs best on 2 )

whats the output from:

netstat -an | grep 80 | wc -l




I would not advise giving the my.cnf any configuration as it could cause more damage, Only set configs on what is actually being used, Start from low and work your way up.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...