Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic

Do you host Drupal on your linode?
Poll ended at Sun Jan 17, 2010 8:33 am
Yes  43%  [ 15 ]
No  51%  [ 18 ]
What is Drupal?  6%  [ 2 ]
Total votes : 35
Author Message
 Post subject: Drupal 6 performance
PostPosted: Sat Jan 17, 2009 8:33 am 
Offline
Senior Newbie

Joined: Sun Jun 29, 2008 7:57 pm
Posts: 6
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.


Last edited by islevegan on Tue Feb 17, 2009 5:29 am, edited 1 time in total.

Top
   
PostPosted: Sat Jan 17, 2009 9:19 am 
Offline
Senior Newbie

Joined: Sun Sep 14, 2008 2:39 am
Posts: 5
WLM: yuval@avramzon.net
Location: Israel
Try to disable all Drupal contrib module, move to a core theme, and see if things improve.

_________________
--yuval


Top
   
 Post subject: I'll restate my request
PostPosted: Sat Jan 17, 2009 9:57 am 
Offline
Senior Newbie

Joined: Sun Jun 29, 2008 7:57 pm
Posts: 6
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.


Top
   
 Post subject:
PostPosted: Sat Jan 17, 2009 10:31 am 
Offline
Senior Member
User avatar

Joined: Mon Jul 21, 2008 1:26 pm
Posts: 171
Website: http://www.rejecttheherd.net
Location: Seattle
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 -

Code:
            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.

Code:
[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
Code:
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.

Image

_________________
Image
Where "Thought Crime" is commited
http://www.rejecttheherd.net


Top
   
PostPosted: Sat Jan 17, 2009 11:39 am 
Offline
Senior Newbie

Joined: Sun Sep 14, 2008 2:39 am
Posts: 5
WLM: yuval@avramzon.net
Location: Israel
islevegan wrote:
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.

_________________
--yuval


Top
   
PostPosted: Sat Jan 17, 2009 12:28 pm 
Offline
Senior Member
User avatar

Joined: Mon Jul 21, 2008 1:26 pm
Posts: 171
Website: http://www.rejecttheherd.net
Location: Seattle
yhager wrote:
islevegan wrote:
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.

_________________
Image

Where "Thought Crime" is commited

http://www.rejecttheherd.net


Top
   
 Post subject:
PostPosted: Sat Jan 17, 2009 2:59 pm 
Offline
Junior Member

Joined: Tue Feb 19, 2008 7:08 am
Posts: 23
Location: USA
You may put

Code:
skip-innodb
skip-networking
skip-bdb


in my.cnf to save some memory.

And replace apache with nginx, lighttpd or cherokee.


Top
   
 Post subject:
PostPosted: Mon Jan 19, 2009 4:14 pm 
Offline
Junior Member
User avatar

Joined: Wed Mar 19, 2008 10:34 pm
Posts: 32
Website: http://www.claws-and-paws.com/
WLM: doug.muth@gmail.com
Yahoo Messenger: dmuthathome
AOL: Dmuth+At+Home
Location: Ardmore, PA
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


Top
   
 Post subject:
PostPosted: Mon Jan 19, 2009 7:03 pm 
Offline
Senior Member
User avatar

Joined: Mon Jul 21, 2008 1:26 pm
Posts: 171
Website: http://www.rejecttheherd.net
Location: Seattle
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

_________________
Image

Where "Thought Crime" is commited

http://www.rejecttheherd.net


Top
   
 Post subject:
PostPosted: Mon Jan 19, 2009 7:41 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
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.


Top
   
 Post subject:
PostPosted: Mon Jan 19, 2009 8:06 pm 
Offline
Senior Member
User avatar

Joined: Thu Mar 06, 2008 12:21 am
Posts: 59
yejun wrote:
You may put

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


Top
   
 Post subject:
PostPosted: Fri Jan 23, 2009 1:04 pm 
Offline
Junior Member

Joined: Wed Sep 03, 2008 9:51 am
Posts: 25
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


Top
   
 Post subject:
PostPosted: Sat Jan 24, 2009 3:49 am 
Offline
Senior Member
User avatar

Joined: Sun Feb 08, 2004 7:18 pm
Posts: 562
Location: Austin
weave wrote:
*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.


Top
   
 Post subject:
PostPosted: Sat Jan 24, 2009 9:34 am 
Offline
Senior Member
User avatar

Joined: Thu Mar 06, 2008 12:21 am
Posts: 59
Xan wrote:
weave wrote:
*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:


Top
   
 Post subject: It's better now
PostPosted: Thu Feb 05, 2009 6:41 am 
Offline
Senior Newbie

Joined: Sun Jun 29, 2008 7:57 pm
Posts: 6
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group