Post Reply  Post Thread 
Pages (2): « First [1] 2 Next > Last »
Server Overloaded - Optimization Needed - Heavy MySQL and PHP
djb2002
Junior Member
**

Posts: 6
Group: Registered
Joined: Oct 2006
Status: Offline
Reputation: 0
Post: #1
Server Overloaded - Optimization Needed - Heavy MySQL and PHP

My site has recently been featured in several magazines and newspapers, and is receiving a VERY HIGH number of hits.

The problem is pages failing to load, and the processor on the 'top' command showing 0% idle for a very long time.

The site is PHP based, and uses a MySQL server.

I have run an optimize on the database, but this hasn't help.

Any help appreciated.

---- Server Specs ----
Athlon – 1.7Ghz
512 MB Ram
1x 80GB HDD
Fedora
Cpanel/WHM
MySQL 4.1.21
Apache 1.3.37
--------------------
free -m
             total       used       free     shared    buffers     cached
Mem:           720        316        404          0          6         81
-/+ buffers/cache:        228        492
Swap:          988        248        740
--------------------
ps aux

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  1692  364 ?        S    Oct05   0:02 init [3]
root         2  0.0  0.0     0    0 ?        S    Oct05   0:00 [migration/0]
root         3  0.0  0.0     0    0 ?        SN   Oct05   0:00 [ksoftirqd/0]
root         4  0.0  0.0     0    0 ?        S    Oct05   0:00 [watchdog/0]
root         5  0.0  0.0     0    0 ?        S<   Oct05   0:00 [events/0]
root         6  0.0  0.0     0    0 ?        S<   Oct05   0:00 [khelper]
root         7  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kthread]
root         9  0.0  0.0     0    0 ?        S<   Oct05   0:02 [kblockd/0]
root        10  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kacpid]
root        59  0.0  0.0     0    0 ?        S<   Oct05   0:00 [khubd]
root       181  0.0  0.0     0    0 ?        S<   Oct05   0:00 [aio/0]
root       182  0.0  0.0     0    0 ?        S<   Oct05   0:00 [xfslogd/0]
root       183  0.0  0.0     0    0 ?        S<   Oct05   0:00 [xfsdatad/0]
root       184  0.0  0.0     0    0 ?        S<   Oct05   0:00 [xfsbufd]
root       180  0.0  0.0     0    0 ?        S    Oct05   0:33 [kswapd0]
root       770  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kseriod]
root       861  0.0  0.0     0    0 ?        S<   Oct05   0:00 [ata/0]
root       894  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kcryptd/0]
root       895  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kmpathd/0]
root       896  0.0  0.0     0    0 ?        S<   Oct05   0:00 [kmirrord]
root       900  0.0  0.0     0    0 ?        S    Oct05   0:02 [kjournald]
root      2736  0.0  0.0     0    0 ?        S    Oct05   0:00 [kjournald]
root      2737  0.0  0.0     0    0 ?        S    Oct05   0:15 [kjournald]
root      2738  0.0  0.0     0    0 ?        S    Oct05   0:00 [kjournald]
root      2739  0.0  0.0     0    0 ?        S    Oct05   0:05 [kjournald]
root      2740  0.0  0.0     0    0 ?        S    Oct05   0:08 [kjournald]
root      2815  0.0  0.0  1588  280 ?        S<s  Oct05   0:00 udevd
named     3323  0.6  1.3 39456 9860 ?        Ssl  Oct05   8:49 /usr/sbin/named -u named
root      3338  0.0  0.0  1596  460 ?        Ss   Oct05   0:04 syslogd -m 0
root      3342  0.0  0.0  1540  344 ?        Ss   Oct05   0:00 klogd -x
root      3379  0.0  0.0  1528  200 ?        S    Oct05   0:00 /usr/sbin/courierlogger -pid=/var/spool/authdaemon/pid -facili
root      3380  0.0  0.0  1848  344 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3381  0.0  0.0  1848  296 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3382  0.0  0.0  1848  296 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3383  0.0  0.0  1848  220 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3384  0.0  0.0  1848  296 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3385  0.0  0.0  1848  220 ?        S    Oct05   0:00 /usr/libexec/courier-authlib/authdaemond
root      3454  0.0  0.0  1824  408 ?        S    Oct05   0:00 /usr/sbin/smartd
root      3463  0.0  0.0  1536  280 ?        Ss   Oct05   0:00 /usr/sbin/acpid
root      3493  0.0  0.0  3988  240 ?        Ss   Oct05   0:00 /usr/sbin/sshd
root      3505  0.0  0.0  2152  392 ?        Ss   Oct05   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root      3514  0.0  0.0  4292  388 ?        S    Oct05   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-fi
mysql     3538 10.4  3.7 148692 27772 ?      Sl   Oct05 145:38 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=m
root      3584  0.0  0.0  1528  272 ?        S    Oct05   0:00 /usr/sbin/courierlogger -pid=/var/run/imapd.pid -start -name=i
root      3585  0.0  0.0  1636  368 ?        S    Oct05   0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs
root      3593  0.0  0.0  1532  148 ?        S    Oct05   0:00 /usr/sbin/courierlogger -pid=/var/run/imapd-ssl.pid -start -na
root      3594  0.0  0.0  1632  288 ?        S    Oct05   0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs
root      3601  0.0  0.0  1532  276 ?        S    Oct05   0:00 /usr/sbin/courierlogger -pid=/var/run/pop3d.pid -start -name=p
root      3602  0.0  0.0  1632  364 ?        S    Oct05   0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs
root      3610  0.0  0.0  1528  148 ?        S    Oct05   0:00 /usr/sbin/courierlogger -pid=/var/run/pop3d-ssl.pid -start -na
root      3611  0.0  0.0  1632  288 ?        S    Oct05   0:00 /usr/lib/courier-imap/libexec/couriertcpd -address=0 -maxprocs
root      4029  0.0  0.0 17020  184 ?        Ss   Oct05   0:00 /usr/sbin/clamd
root      4139  0.0  0.3 25588 2580 ?        Ss   Oct05   0:08 /usr/bin/spamd -d --allowed-ips=127.0.0.1 --pidfile=/var/run/s
root      4149  0.1  2.1 50844 15752 ?       Ssl  Oct05   1:26 /usr/sbin/clamd
mailnull  4153  0.0  0.0  7288  416 ?        Ss   Oct05   0:00 /usr/sbin/exim -bd -oX 26
mailnull  4159  0.0  0.0  7284  524 ?        Ss   Oct05   0:01 /usr/sbin/exim -bd -q60m
mailnull  4164  0.0  0.0  7276  360 ?        Ss   Oct05   0:00 /usr/sbin/exim -tls-on-connect -bd -oX 465
root      4169  0.1  0.2  8880 1496 ?        S    Oct05   1:34 lfd - sleeping
root      4235  0.0  0.0  4460  448 ?        Ss   Oct05   0:00 crond
root      4251  0.0  0.0  1700  320 ?        Ss   Oct05   0:00 /usr/sbin/atd
root      4375  0.0  0.1  3120  816 ?        S    Oct05   0:02 antirelayd
root      4616  0.0  0.0  6160  336 ?        Ss   Oct05   0:00 pure-ftpd (SERVER)
root      4631  0.0  0.0  5700  304 ?        S    Oct05   0:00 /usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/sbin/pureau
dbus      5051  0.0  0.0  2308  268 ?        Ss   Oct05   0:00 dbus-daemon-1 --system
root      5105  0.0  0.1  5940 1064 ?        Ss   Oct05   0:03 hald
root      5195  0.0  0.0  1556  280 ?        Ss   Oct05   0:00 /usr/sbin/portsentry -tcp
root      5334  0.0  0.0  1532  268 tty1     Ss+  Oct05   0:00 /sbin/mingetty tty1
root      5335  0.0  0.0  1528  268 tty2     Ss+  Oct05   0:00 /sbin/mingetty tty2
root      5336  0.0  0.0  1528  268 tty3     Ss+  Oct05   0:00 /sbin/mingetty tty3
root      5337  0.0  0.0  1528  268 tty4     Ss+  Oct05   0:00 /sbin/mingetty tty4
root      5338  0.0  0.0  1532  268 tty5     Ss+  Oct05   0:00 /sbin/mingetty tty5
root      5602  0.0  0.0  1528  268 tty6     Ss+  Oct05   0:00 /sbin/mingetty tty6
root     12655  0.0  0.2 11880 2084 ?        S    Oct05   0:02 chkservd
root     22591  0.0  0.1  6984 1400 ?        S    03:31   0:01 cpbandwd
root     22659  0.0  0.1 16860 1384 ?        SN   03:31   0:17 cpanellogd - sleeping for logs
mailnull 22676  0.0  0.1  7780 1456 ?        S    03:31   0:00 eximstats
mailman  22742  0.0  0.0 10288  500 ?        Ss   03:31   0:00 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22743  0.0  0.1 10100 1048 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22744  0.0  0.1 10096 1064 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22745  0.0  0.1 10076 1048 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22746  0.0  0.1 10132 1060 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22751  0.0  0.1 10084 1072 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22752  0.0  0.1 10096 1084 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22753  0.0  0.1 10096 1060 ?        S    03:31   0:01 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
mailman  22754  0.0  0.1 10100 1068 ?        S    03:31   0:00 /usr/local/bin/python2.4 /usr/local/cpanel/3rdparty/mailman/bi
root     22928  0.0  0.3 17536 2460 ?        S    03:32   0:00 cpsrvd - waiting for connections
root     25685  0.0  0.0  7804  616 ?        Ss   04:02   0:00 cupsd
djbnet     503  0.3  0.1 30472 1028 ?        S    07:27   1:15 spamd child
root      3986  0.0  0.1  7024  796 ?        Rs   07:37   0:05 sshd: root@pts/0
root      4087  0.0  0.1  4432  872 pts/0    Ss   07:37   0:00 -bash
root     10428  0.5  2.6 30280 19252 ?       S    09:37   1:36 spamd child
root     12183  0.0  0.0 11952  404 ?        S    11:24   0:00 /etc/authlib/authProg
root     21739  0.0  0.2 11948 1492 ?        S    11:36   0:00 /etc/authlib/authProg
root     25667  0.0  0.2 11948 1896 ?        S    11:41   0:00 /etc/authlib/authProg
root      9518  0.0  0.2 11948 2112 ?        S    12:19   0:00 /etc/authlib/authProg
root     12695  0.0  0.0 11948  424 ?        S    12:30   0:00 /etc/authlib/authProg
root     19489  0.0  0.0     0    0 ?        S    12:38   0:00 [pdflush]
root      7836  0.3  2.8 28624 21076 ?       S    13:16   0:10 spamd child
root      2783  0.0  0.0     0    0 ?        S    13:58   0:00 [pdflush]
root      9039  0.3  0.7 13448 5552 ?        Ss   14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9058  0.4  0.7 14152 5652 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9059  0.2  0.7 14152 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9060  0.4  0.7 14128 5604 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9061  0.4  0.7 14152 5656 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9062  0.2  0.7 14144 5600 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9068  1.6  1.4 18976 10600 ?       S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9069  0.3  0.7 14116 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9070  0.1  0.7 14160 5548 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9072  0.3  0.7 14128 5568 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9073  0.2  0.7 14164 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9074  0.2  0.7 14128 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9076  0.3  0.7 14144 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9078  0.2  0.7 14128 5616 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9079  0.2  0.7 14160 5580 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9080  0.3  0.7 14152 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9081  0.3  0.7 14128 5604 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9082  0.3  0.7 14144 5588 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9083  0.4  0.7 14256 5712 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9084  0.3  0.7 14184 5676 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9085  0.2  0.7 14092 5552 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9092  0.3  0.7 14144 5592 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9093  0.3  0.8 14928 6280 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9094  0.2  0.7 14116 5604 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9095  0.5  0.7 14148 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9096  0.4  0.7 14128 5652 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9099  0.1  0.7 13976 5308 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9100  0.2  0.7 14160 5580 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9101  0.2  0.7 14160 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9102  0.2  0.7 14348 5748 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9103  0.3  0.7 14108 5560 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9105  0.3  0.7 14124 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9106  0.2  0.7 14116 5556 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9107  0.4  0.7 14168 5664 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9108  0.3  0.7 14348 5788 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9109  0.4  0.7 14148 5624 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9113  0.2  0.7 14148 5564 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9116  0.3  0.7 14084 5588 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9118  0.3  0.7 14124 5616 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9119  0.1  0.7 14128 5524 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9120  0.4  0.7 14128 5656 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9122  0.2  0.7 14124 5560 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9124  0.6  0.7 14128 5636 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9125  0.3  0.7 14152 5632 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9126  0.2  0.7 14168 5588 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9127  0.3  0.7 14160 5556 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9132  0.3  0.7 14160 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9133  0.4  0.7 14164 5644 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9134  0.2  0.7 14176 5636 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9135  0.3  0.7 14128 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9136  0.1  0.7 14108 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9140  0.3  0.7 14128 5532 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9142  0.3  0.7 14144 5592 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9143  0.4  0.7 14352 5780 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9149  0.4  0.7 14152 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9150  0.5  0.7 14148 5660 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9152  0.2  0.7 14128 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9155  0.3  0.7 14164 5680 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9156  0.5  0.7 14152 5660 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9157  0.0  0.7 13968 5316 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9159  0.4  0.7 14164 5604 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9161  0.3  0.7 14176 5668 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9164  0.4  0.7 14152 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9165  0.6  0.7 14124 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9166  0.3  0.7 14164 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9167  0.4  0.7 14176 5620 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9169  0.2  0.7 14132 5616 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9170  0.2  0.7 14108 5600 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9171  0.4  0.7 14148 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9184  0.4  0.7 14144 5576 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9185  0.3  0.7 14144 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9190  0.7  0.7 14160 5652 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9192  0.2  0.7 14108 5548 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9193  0.4  0.7 14128 5600 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9194  0.6  0.7 14160 5668 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9195  0.3  0.7 14148 5656 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9202  0.5  0.7 14144 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9204  0.1  0.7 14128 5532 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9205  0.4  0.7 14108 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9206  0.8  0.7 14124 5616 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9207  0.3  0.7 14128 5568 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9218  0.4  0.7 14164 5604 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9220  0.6  0.7 14176 5660 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9227  0.6  0.7 14124 5612 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9228  0.3  0.7 14280 5704 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9229  0.1  0.7 14128 5656 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9235  0.2  0.7 14124 5516 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9236  0.5  0.7 14172 5656 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9237  0.3  0.7 14128 5564 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9245  0.2  0.7 14124 5568 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9246  0.2  0.7 14160 5552 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9252  0.3  0.7 14128 5572 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9254  1.0  0.7 14128 5612 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9255  0.2  0.7 14144 5652 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9257  0.5  0.7 14124 5580 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9258  0.3  0.7 14116 5572 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9264  0.4  0.7 14236 5632 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9265  0.4  0.7 14172 5644 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9267  0.6  0.7 14128 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9268  0.3  0.7 14124 5556 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9269  0.3  0.7 14172 5660 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9283  0.7  0.7 14128 5612 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9284  0.3  0.7 14144 5644 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9286  0.7  0.7 14124 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9287  0.5  0.7 14124 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9288  0.4  0.7 14128 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9311  0.5  0.7 14124 5624 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9312  0.1  0.7 14016 5308 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9313  0.6  0.7 14176 5696 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9315  0.7  0.7 14164 5668 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9316  0.5  0.7 14144 5612 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9323  0.5  0.7 14124 5624 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9324  0.2  0.7 14164 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9326  0.4  0.7 14124 5628 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9327  0.2  0.7 14124 5552 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9328  0.3  0.7 14108 5580 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9335  0.2  0.7 14144 5528 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9336  0.5  0.7 14144 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9339  0.6  0.7 14124 5596 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9340  0.4  0.7 14152 5660 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9343  0.4  0.7 14144 5664 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9351  0.4  0.7 14164 5664 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9352  0.3  0.7 14144 5552 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9353  0.5  0.7 14128 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9354  0.4  0.7 14172 5644 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9355  0.6  0.7 14288 5700 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9360  0.4  0.7 14124 5516 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9361  0.4  0.7 14124 5572 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9362  0.2  0.7 14124 5520 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9363  0.2  0.7 14136 5548 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9364  0.3  0.7 14176 5580 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9394  0.6  0.7 14128 5572 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9398  0.0  0.6 13608 4784 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9413  0.4  0.7 14152 5564 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9414  0.2  0.7 14124 5608 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9415  0.5  0.7 14108 5592 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9439  0.5  0.7 14124 5636 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9440  0.3  0.7 14232 5672 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9441  0.5  0.7 14128 5564 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9442  0.5  0.7 14176 5652 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9443  0.5  0.7 14128 5568 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9453  0.2  0.7 14176 5584 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9454  0.6  0.7 14172 5676 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9455  0.6  0.7 14124 5600 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9456  0.3  0.7 14124 5600 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9457  0.3  0.7 14116 5572 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9463  0.2  0.7 14128 5612 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9464  0.4  0.7 14180 5640 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9465  0.3  0.7 14220 5680 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9466  0.4  0.7 14108 5544 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
nobody    9467  0.4  0.7 14108 5616 ?        S    14:08   0:00 /usr/local/apache/bin/httpd -DSSL
root      9980  0.0  0.1  2380  748 pts/0    R+   14:08   0:00 ps aux

------------------------------------

Thanks in advance for any help,

Daniel

10-06-2006 01:13 PM

This post was last modified: 10-06-2006 05:01 PM by djb2002.

Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #2
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

Please post your top stats, my.cnf and httpd.conf variables. From the current stats, it seems like you really need to upgrade to a more powerful machine.

10-06-2006 07:53 PM
Find all posts by this user Quote this message in a reply
djb2002
Junior Member
**

Posts: 6
Group: Registered
Joined: Oct 2006
Status: Offline
Reputation: 0
Post: #3
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

-----------------------------------------
my.cnf

[mysqld]
set-variable = max_connections=500
safe-show-database
old-passwords = 1
-----------------------------------------
httpd.conf

RLimitMEM 120572245
RLimitCPU 240
Alias /bandwidth/ /usr/local/bandmin/htdocs/
ServerType standalone
ServerRoot /usr/local/apache
PidFile /usr/local/apache/logs/httpd.pid
ScoreBoardFile /usr/local/apache/logs/httpd.scoreboard
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 7
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 125
MaxRequestsPerChild 50
-----------------------------------------

The MaxClients, I reduced myself from 150 to 125, hoping that it would stop the server 'falling over' with the high load.

The server (at the moment) has gone quiet for a while, so the top stats aren't very accurate, but here they are anything (as of now):

The average load was showing as high as 22 previously !!!

-----------------------------------------
top - 22:52:47 up 1 day, 7:53, 1 user, load average: 1.34, 1.05, 0.99
Tasks: 161 total, 4 running, 155 sleeping, 0 stopped, 2 zombie
Cpu(s): 72.9% us, 12.5% sy, 0.0% ni, 13.5% id, 0.3% wa, 0.7% hi, 0.0% si
Mem: 738256k total, 710268k used, 27988k free, 105412k buffers
Swap: 1012052k total, 227164k used, 784888k free, 292244k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3538 mysql 15 0 141m 23m 2632 S 15.6 3.3 226:14.75 mysqld
12494 nobody 16 0 17152 8616 2360 S 15.6 1.2 0:01.47 httpd
13522 noto0870 18 0 7956 6588 1392 R 10.3 0.9 0:00.31 YaBB.cgi
13524 noto0870 18 0 7944 6596 1392 R 10.0 0.9 0:00.30 YaBB.cgi
13523 noto0870 18 0 7824 6420 1392 R 9.6 0.9 0:00.29 YaBB.cgi
12227 nobody 15 0 14284 5644 2264 S 3.0 0.8 0:00.52 httpd
13500 root 25 0 8192 3728 2676 S 2.7 0.5 0:00.08 exim
4149 root 16 0 59040 15m 576 S 1.7 2.2 1:58.84 clamd
12332 nobody 15 0 14284 5564 2264 S 1.7 0.8 0:00.53 httpd
3642 djbnet 16 0 30760 23m 2060 S 1.3 3.3 1:03.78 spamd
9358 nobody 15 0 17676 9316 2388 S 1.3 1.3 0:03.62 httpd
11675 nobody 15 0 14300 5656 2264 S 1.3 0.8 0:00.86 httpd
11843 nobody 15 0 14180 5756 2320 S 1.3 0.8 0:00.68 httpd
13011 nobody 15 0 14188 5500 2240 S 1.3 0.7 0:00.19 httpd
3323 named 18 0 40000 10m 1124 S 0.7 1.4 13:00.70 named
8733 nobody 15 0 17472 8960 2388 S 0.7 1.2 0:08.93 httpd
9855 nobody 15 0 14288 5652 2332 S 0.7 0.8 0:01.49 httpd
-----------------------------------------

Thanks again,
Daniel

10-06-2006 09:56 PM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #4
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

It's tough to offer optimization suggestions on loads based on off-peak times. Can you please post these stats from a peak time?

Try the following httpd optimizations. They will only help a bit!

Code:
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 3
MinSpareServers 15
MaxSpareServers 35
StartServers 10
MaxClients 125
MaxRequestsPerChild 1000


Try the following my.cnf for less ram usage. But I am not sure if it's the best optimization because the stats from a peak time weren't posted.

Code:
[mysqld]
max_connections=150
safe-show-database
old-passwords = 1
table_cache = 768
max_allowed_packet = 6M
sort_buffer_size = 768K
join_buffer_size = 768K
read_buffer_size = 1M
thread_cache_size = 8
wait_timeout = 60
interactive_timeout = 60
query_cache_size = 16M


Try disabling spam assasin and other things like mailing lists if not necessary. From the current stats, it seems like there is a Perl based forum hosted on the server that's eating up most of the CPU. Consider converting to a PHP-based forum like MyBB or phpBB. That will help a lot!

If all else fails, disable apache logs and rely on third party off-site statistics reporting services. Though this won't include data transfer count.

The ram is almost exhausted even at off-peak time, so optimizations won't help too much here.

10-07-2006 12:56 AM

This post was last modified: 10-07-2006 12:58 AM by Pacifier.

Find all posts by this user Quote this message in a reply
djb2002
Junior Member
**

Posts: 6
Group: Registered
Joined: Oct 2006
Status: Offline
Reputation: 0
Post: #5
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

Thanks for your reply.

Here is a 'top' at peak time:

Thanks
Daniel

top - 16:39:27 up 4 days, 1:40, 1 user, load average: 12.75, 12.89, 12.21
Tasks: 192 total, 15 running, 176 sleeping, 1 stopped, 0 zombie
Cpu(s): 63.9% us, 35.8% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.3% hi, 0.0% si
Mem: 738256k total, 673016k used, 65240k free, 77668k buffers
Swap: 1012052k total, 179284k used, 832768k free, 170132k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16889 nobody 16 0 21184 12m 2244 D 6.3 1.7 0:00.21 httpd
16943 nobody 16 0 20924 11m 2044 R 5.7 1.6 0:00.18 httpd
16792 nobody 16 0 19788 10m 2252 D 5.0 1.5 0:00.18 httpd
16871 nobody 16 0 19428 10m 2344 R 5.0 1.5 0:00.18 httpd
16931 nobody 16 0 19892 10m 2084 R 4.7 1.5 0:00.15 httpd
16965 nobody 16 0 19780 10m 2048 D 4.7 1.5 0:00.15 httpd
16696 nobody 16 0 19104 10m 2264 R 4.4 1.4 0:00.19 httpd
16881 nobody 16 0 19084 10m 2280 D 4.4 1.4 0:00.16 httpd
16882 nobody 16 0 18888 10m 2260 D 4.4 1.4 0:00.16 httpd
16944 nobody 16 0 19648 10m 2028 R 4.4 1.5 0:00.14 httpd
16951 nobody 16 0 18996 10m 2060 D 4.1 1.4 0:00.13 httpd
16982 nobody 16 0 18896 9.9m 2048 D 4.1 1.4 0:00.13 httpd
16601 nobody 16 0 18664 9.9m 2276 R 3.8 1.4 0:00.20 httpd
16794 nobody 16 0 18488 9964 2244 D 3.8 1.3 0:00.18 httpd
16609 nobody 16 0 17452 8956 2280 R 3.1 1.2 0:00.19 httpd
16851 nobody 16 0 17264 8696 2260 D 3.1 1.2 0:00.12 httpd
16980 nobody 16 0 18152 9356 2072 R 3.1 1.3 0:00.10 httpd
16872 nobody 16 0 17048 8480 2244 D 2.8 1.1 0:00.11 httpd
16945 nobody 16 0 16740 7988 2048 D 2.8 1.1 0:00.09 httpd
16861 nobody 15 0 14120 5504 2228 S 1.3 0.7 0:00.05 httpd
3323 named 18 0 40060 10m 1248 S 0.9 1.5 28:26.81 named
16859 nobody 16 0 14132 5560 2260 S 0.9 0.8 0:00.06 httpd
16862 nobody 15 0 14284 5640 2244 S 0.9 0.8 0:00.04 httpd
16953 nobody 16 0 13996 5244 2072 S 0.9 0.7 0:00.03 httpd
3538 mysql 25 0 142m 27m 2688 R 0.6 3.8 522:24.91 mysqld
16502 nobody 16 0 14128 5628 2272 S 0.6 0.8 0:00.13 httpd
16534 nobody 15 0 14296 5672 2256 S 0.6 0.8 0:00.12 httpd
16793 nobody 16 0 14104 5512 2240 S 0.6 0.7 0:00.04 httpd
16849 nobody 16 0 14128 5548 2252 S 0.6 0.8 0:00.05 httpd
16880 nobody 16 0 13984 5376 2224 S 0.6 0.7 0:00.03 httpd
16934 nobody 16 0 13980 5276 2060 S 0.6 0.7 0:00.02 httpd
16954 nobody 16 0 13980 5292 2076 S 0.6 0.7 0:00.02 httpd
16955 nobody 25 0 14004 5224 2024 S 0.6 0.7 0:00.02 httpd
16961 nobody 16 0 13996 5256 2080 S 0.6 0.7 0:00.02 httpd
16963 nobody 16 0 13996 5248 2072 S 0.6 0.7 0:00.02 httpd
16964 nobody 25 0 13980 5240 2024 S 0.6 0.7 0:00.02 httpd
16971 nobody 25 0 13988 5248 2024 S 0.6 0.7 0:00.02 httpd

10-09-2006 03:42 PM

This post was last modified: 10-09-2006 03:43 PM by djb2002.

Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #6
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

You will have to disable apache logs and other un-necessary modules. Or upgrade to at least a P4 2.4ghz CPU or better yet an AMD 3000+ with 1gb ram. There isn't much that can be done here as apache is using up all the CPU.

10-09-2006 10:34 PM
Find all posts by this user Quote this message in a reply
djb2002
Junior Member
**

Posts: 6
Group: Registered
Joined: Oct 2006
Status: Offline
Reputation: 0
Post: #7
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

I'm thinking of going for an Intel Pentium D 2.8Ghz (Dual Core) with 1GB DDR Ram, and a SATA hard drive.

Do you think that should fix the problem ??

Thanks!
Daniel

10-10-2006 06:43 PM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #8
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

Yes, hopefully it will (speaking from the stats available).

10-10-2006 09:52 PM
Find all posts by this user Quote this message in a reply
djb2002
Junior Member
**

Posts: 6
Group: Registered
Joined: Oct 2006
Status: Offline
Reputation: 0
Post: #9
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

THanks.

OK, gone for the new server, but can't understand the following:

I cannot understand some of the stats showing on this new machine.

It is showing that RAM being used is approx 700MB, although there is nothing installed on this server yet (apart from cpanel), and nothing is running - The CPU is showing as 100% idle.

Do you know why this is happening ??

Thanks
Daniel

top - 23:54:13 up 23:45, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 116 total, 1 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.0% sy, 0.0% ni, 100.0% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 1022928k total, 743056k used, 279872k free, 18800k buffers
Swap: 2040212k total, 4k used, 2040208k free, 476780k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 16 0 1736 528 456 S 0.0 0.1 0:01.02 init
2 root RT 0 0 0 0 S 0.0 0.0 0:00.14 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.57 migration/1
6 root 34 19 0 0 0 S 0.0 0.0 0:00.01 ksoftirqd/1
7 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1
8 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0
9 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/1
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
11 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
14 root 10 -5 0 0 0 S 0.0 0.0 0:00.70 kblockd/0
15 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kblockd/1
16 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
74 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
76 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
223 root 15 0 0 0 0 S 0.0 0.0 0:03.54 kswapd0

10-11-2006 11:02 PM
Find all posts by this user Quote this message in a reply
Pacifier
Administrator
*******

Posts: 214
Group: Administrators
Joined: May 2006
Status: Offline
Reputation: 0
Post: #10
RE: Server Overloaded - Optimization Needed - Heavy MySQL and PHP

That's absolutely alright as Linux manages memory in a different way than windows. You should read my article "Linux server loads explained" in articles section. Try using free -m and see the explanation in that article.

10-12-2006 02:00 AM

This post was last modified: 10-12-2006 02:01 AM by Pacifier.

Find all posts by this user Quote this message in a reply
Pages (2): « First [1] 2 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: