Drupal 6 performance

I have a linode 360 with Ubuntu 8.04 LTS from Linode's "Deploy a Linux Distribution" button.

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

Try to disable all Drupal contrib module, move to a core theme, and see if things improve.

I am using the default, core theme.

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 moved my Drupal Sites from Dreamhost to Linode and there is a considerable increase in performance. Here's how I went about it, I bootstrapped Gentoo specifically to my Linode so she's running lean and mean. I then also went about hitting the various Drupal performance sites and did some tweaking for MySQL. I also run XCache and I'm running a lot of contributed modules also.

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 -

http://www.rejecttheherd.net

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.

![](http://i147.photobucket.com/albums/r309 … k/htop.png">http://i147.photobucket.com/albums/r309/marcus0263/Geek/htop.png" />

@islevegan:

I am using the default, core theme.

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

There will always be something to do to improve performance. The question is which direction is the most worth while dealing with.

If you invest hours reading docs and experimenting, and then improve 1% performance, you might feel like you wasted your time. While improving PHP/Apache can add a lot, usually, I find it that removing the bottlenecks from the application is the most cost-effective.

I was not saying you should run drupal core only forever, just as means of finding out which module slows you down. Many contrib modules are not very well written, and it might just be inefficient. If you find a problematic module, then you can: remove/replace it, search it's issue queue/file a patch/etc.

My linode is running gentoo/apache/php+APC, and I am very happy with my drupal 6 performance.

@yhager:

@islevegan:

I am using the default, core theme.

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

There will always be something to do to improve performance. The question is which direction is the most worth while dealing with.

If you invest hours reading docs and experimenting, and then improve 1% performance, you might feel like you wasted your time. While improving PHP/Apache can add a lot, usually, I find it that removing the bottlenecks from the application is the most cost-effective.

I was not saying you should run drupal core only forever, just as means of finding out which module slows you down. Many contrib modules are not very well written, and it might just be inefficient. If you find a problematic module, then you can: remove/replace it, search it's issue queue/file a patch/etc.

My linode is running gentoo/apache/php+APC, and I am very happy with my drupal 6 performance.

That's what I did, first off I went with a bootstrapped install of Gentoo doesn't have any un-needed processes or applications running. I then spent a good chunk of time googleing for performance related information for Drupal. Did a good chunk tweak here, tweak there.

Overall Drupal on a Linode rocks! I'm very happy with it on Linode. IMO the only thing better than running Drupal on Linode is to run your own hardware in a CoLo.

You may put

skip-innodb
skip-networking
skip-bdb

in my.cnf to save some memory.

And replace apache with nginx, lighttpd or cherokee.

I've been running Drupal on both my linodes, and the performance has been absolutely rockin'. Most pages load in 1-2 seconds.

If you haven't already, I would strongly recommend you install the package "munin" (http://munin.projects.linpro.no/). That will allow you to get graphics of CPU, I/O, network, and RAM usage. That will allow you to better get an idea of where the problem might be.

If you're running any sort of PHP Cache, I would also suggest that you run APC. (http://us3.php.net/apc)

If you're running Ubuntu, you can apt-get both of these.

Let me know if you have any questions.

– Doug

Been using xcache, I'm pleased with it and haven't run into any problems. Here's some scoop about xcache, eaccelerator and apc. These guys are a good source for Drupal tweaks.

http://2bits.com/articles/benchmarking- … pared.html">http://2bits.com/articles/benchmarking-drupal-with-php-op-code-caches-apc-eaccelerator-and-xcache-compared.html

islevegan:

You're using over 300MB of memory, and as a result you're swapping a lot. That looks ridiculously high for any website, Drupal or not, with near zero traffic. What on earth are you running on your server?

Increasing the PHP memory limit will only do harm at this point, because you don't have any memory left. You only need to increase the PHP memory limit if you're getting "out of memory" errors in the middle of your Drupal pages (possibly as a result of having too many modules).

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 :-)

Don't know if you got it fixed or not, but here's a case study from 2bits:

http://2bits.com/articles/presentation- … study.html">http://2bits.com/articles/presentation-diagnosing-and-speeding-slow-drupal-site-case-study.html

@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 :lol:

I had forgotten about a web based a/v chat java application that I had installed / tested a few months ago.

I removed that stuff and the java stuff and it's much happier now :-)

Thanks to all for the helpful suggestions.

I am still experimenting with my 720 linode server. I am very pleased with its performance.

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

I too have had issues with version 6. Version 5 was solid and fairly streamlined.

Tune what you can in Apache (MaxThreads, MaxClients, etc.). What I use is here. You ought to look into caching within Drupal.

Its odd to see that much utilization with NO traffic. I know Google/Yahoo/etc beat up my drupal site bad when they crawl.

When I reboot the linode I can connect via ssh and when I run 'top' I see the memory generally climb till there is none or virtually none left.

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.

when i tried posting, it gave me an error each time. i see that the post made it on though, but I can't remove the duplication only edit…so this is an edit of the duplication.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct