Drupal 6 performance
It is serving two websites with virtually zero traffic at this point. I've been configuring and trying out different modules and capabilities with my Drupal 6 installation and it has gotten quite slow.
I have the PHP memory limit at 64mb, is that too low?
Here is the result of some system checks, does anything look awry here:
root@secret:~# cat /proc/meminfo
MemTotal: 368836 kB
MemFree: 22636 kB
Buffers: 956 kB
Cached: 14556 kB
SwapCached: 53148 kB
Active: 232600 kB
Inactive: 68588 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 368836 kB
LowFree: 22636 kB
SwapTotal: 524280 kB
SwapFree: 255992 kB
Dirty: 220 kB
Writeback: 0 kB
AnonPages: 269704 kB
Mapped: 10204 kB
Slab: 14704 kB
PageTables: 8692 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 708696 kB
Committed_AS: 764124 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 2644 kB
VmallocChunk: 34359735723 kB
root@secret:~# free -m
total used free shared buffers cached
Mem: 360 338 22 0 0 14
-/+ buffers/cache: 322 37
Swap: 511 261 250
root@secret:~# free -m -t
total used free shared buffers cached
Mem: 360 336 23 0 0 14
-/+ buffers/cache: 321 39
Swap: 511 261 250
Total: 872 598 273
root@secret:~# vmstat
procs –---------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 268232 24392 988 14636 10 10 13 12 52 70 0 0 99 1
root@secret:~# top
top - 12:08:48 up 12:03, 1 user, load average: 0.00, 0.09, 0.17
Tasks: 89 total, 1 running, 88 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 98.3%id, 1.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 368836k total, 364216k used, 4620k free, 3332k buffers
Swap: 524280k total, 268732k used, 255548k free, 25808k cached
Any comments on how I might improve performance? Seems that performance for the other website hosted on this linode is not so much affected…they do have the same drupal installation but different folders for each website within that one drupal installation, so there are separate modules, themes, etc.
Mahalo for your time.
18 Replies
I'm quite sure that disabling the extra modules would improve performance considerably.
I wish to keep the modules I'm using, so my question is mainly if there is anything I can / should do to improve performance in the system, or within Drupal without disabling functionality. Perhaps I need to change PHP memory (for example) or something else that an experienced Linux admin would be able to detect from the stats I provided in my initial post.
Thanks for your time and suggestion.
I also run two Linodes, one for Apache/Drupal and the other Linode as a dedicated MySQL server. You really don't need to do this but I chose to go that route and I'm happy.
I still maintain my family website with Dreamhost on their so called VPS and again there is a drastic performance difference with Linode.
Here's my stats with Drupal on my Linode -
total used free shared buffers cached
Mem: 722012 460068 261944 0 65880 137176
-/+ buffers/cache: 257012 465000
Swap: 262136 0 262136
You can also check it out for yourself -
Edit: -
Also here's my mysql config, but this works for me. You'll need to tweak it for your own environment.
[mysqld]
character-set-server = utf8
default-character-set = utf8
user = mysql
port = 3306
socket = /var/run/mysqld/mysqld.sock
pid-file = /var/run/mysqld/mysqld.pid
log-error = /var/log/mysql/mysqld.err
basedir = /usr
datadir = /var/lib/mysql
skip-locking
key_buffer = 32M
key_buffer_size = 125M
max_allowed_packet = 16M
table_cache = 1024
sort_buffer_size = 3M
net_buffer_length = 8K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 64M
language = /usr/share/mysql/english
max_connections = 30
join_buffer_size = 3M
read_buffer_size = 2M
thread_stack = 128K
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1800
connect_timeout = 10
max_user_connections = 55
max_connect_errors = 1000
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
expire_logs_days = 60
tmp_table_size = 16M
long_query_time = 5
log_slow_queries = /var/log/mysql/mysql-slow.log
binlog-do-db = critical_data
thread_concurrency = 8
[isamchk]
key_buffer = 16M
sort_buffer_size = 16M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 16M
sort_buffer_size = 16M
read_buffer = 8M
write_buffer = 8M
My xcache settings
auto_globals_jit="0"
xcache.cacher="1"
xcache.size="64M"
xcache.count="4"
xcache.slots="8k"
xcache.var_size="64M"
xcache.var_count="4"
xcache.readonly_protection="0"
xcache.mmap_path="/dev/zero"
xcache.stat="1"
xcache.coverager="1"
xcache.coveragedump_directory=""
xcache.admin.enable_auth="1
For Apache I also have the Event MPM, so with a couple thousand hits a day she does alright. Here's my htop output this a.m.
.
1. Reboot.
2. Run "free - m" again. The real amount of memory you have left is the last number on the "-/+ buffers/cache" line.
@yejun:
You may put
skip-innodb skip-networking skip-bdb
in my.cnf to save some memory.
Some memory? Those three lines dropped my memory usage from 139M to 33M
@weave:
Some memory? Those three lines dropped my memory usage from 139M to 33M
:-)
I'd expect the savings from those three lines to be pretty minimal. Are you sure you weren't comparing apples and oranges? It sounds like MySQL with your previous config had been running for a while, so all its caches and buffers etc were full.
@Xan:
@weave:Some memory? Those three lines dropped my memory usage from 139M to 33M
:-) I'd expect the savings from those three lines to be pretty minimal. Are you sure you weren't comparing apples and oranges? It sounds like MySQL with your previous config had been running for a while, so all its caches and buffers etc were full.
Yeah, that must have been it. OK, so my giddyness was a bit premature
I removed that stuff and the java stuff and it's much happier now
Thanks to all for the helpful suggestions.
I had joomla and vbulletin on an Ubuntu 8.04 LTX. It was very responsive.
I have a license for Vivvo that I intend to integrate with vBulletin. I will hopefully have that done tomorrow. I expect its performance to be very good. If not, I will go back to Joomla or Drupal. I have Drupal on another server with a different company. It is only a 540 xen vps with no swap memory. It still does very well along with several other modest sites.
Jeff
Tune what you can in Apache (MaxThreads, MaxClients, etc.). What I use is here
Its odd to see that much utilization with NO traffic. I know Google/Yahoo/etc beat up my drupal site bad when they crawl.
I have three domain names point to my drupal 6.9 install - one of them is brand new, from dyndns.org just as a future place to test things.
I noticed that the two other domains have some of the same modules and decided to consolidate the common modules to the …sites/all/modules folder. I think that there was a bit of time when "Views" and "Backup & Migrate" modules folder were in all/modules and at least one of the individual sites modules/ folders at the same time and possibly different versions in each place.
Now my linode uses lots of memory every time it is rebooted. I have tried turning off all the non core modules and then moving them from the modules folder to a '/sitename/modules-disabled' folder but the problem persists. I haven't tried this last procedure with the other domain.
Any ideas what might be happening and how to resolve it? The mysql and apache processes are both taking ~100 MB even when the sites are idle.