VPS 512 MB RAM with WordPressMU comes to consumes lots of memory
- by CAPitalZ
I have googled for days and gathered all optimization suggestions and tried.
My sites are not getting any high hits.
May be like 100 hits per day [all my sites combined].
Here are my specs
I have 512 MB RAM VPS with burstable 1024 MB.
Centos 5 32-bit & cPanel/WHM
Apache 2.2
MySQL 5.0
PHP 5.3.2
Here is my Configs
I have 2 WordPressMU production sites, and 1 test site
my.cnf
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
skip-bdb
skip-innodb
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#CAPitalZ
thread_cache_size=8
thread_concurrency=4
#query_cache_type=1
#query_cache_limit=1M
query_cache_size=16M
concurrent_insert=2
low_priority_updates=1
max_connections=50
tmp_table_size=16M
max_heap_table_size=16M
join_buffer_size=1M
interactive_timeout=25
wait_timeout=1000
#connect_timout=10 not able to restart mysql
max_connect_errors=10
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
skip-networking
# Disable Federated by default
skip-federated
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
[mysqld_safe]
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
httpd.conf
I have unselected many modules and recompiled using EasyApache in WHM.
Only have the following modules built
Deflate
Expires
Fileprotect
Imagemap
MPM Prefork
Version [default]
EAccelerator for PHP
Bcmath
Calendar
CurlSSL [I'm using Curl. But I don't have any https sites]
Expat
GD [for image cropping]
Gettext
Imap
Mbregex [default]
Mbstring [need both Mbregex and Mbstring for utf-8]
Mysql of the system
MySQL "Improved" extension.
Sockets
TTF (FreeType) [I'm using custom font]
Zlib
Under Global Configuration
I only have FollowSymLinks enabled
I Have TraceEnable, ServerSignature, FileETag OFF
ServerTokens ProductOnly
DirectoryIndex Priority has index.php as the first one
I have removed Clamd [Clam Anti-virus]
SpamAssasin is Off
Under Tweak Settings
Default catch-all/default address behavior for new accounts. This is set to "fail"
All stats programs turned off
I have eAccelerator installed and checked in phpinfo and its working
[Pre VirtualHost Include under WHM]
Timeout 20
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 3
MinSpareServers 1
MaxSpareServers 3
StartServers 1
ServerLimit 50
MaxClients 50
MaxRequestsPerChild 4000
ExtendedStatus Off
#ServerType standalone this throws error
HostnameLookups Off
<Directory "/">
AllowOverride None
</Directory>
My sites will take ages to load and WHM/CPanel will not even load.
adadaa.com/
http://adadaa.net/
kadais.ca/
My average memory consumption is like 1000 MB! [yes always bursting]
The process that consumes most CPU and also most memory is mysql
But I also get like 15 httpd processes [when its bursting]
I already got warning from cpuwatchcheck saying
"While processing, the cpu has been
maxed out for more than a 6 hour period. The current load/uptime line on the server at the time of this email is
07:00:37 up 11:30, 0 users, load average: 14.64, 16.79, 20.07"
I don't know, I have tried switching these config values many different times, but nothing seems to work.
Please show some light... Thanks