2

I have a vb 3.8.4 forum and a drupal pressflow 6.22 site on together on my hosting server

When i added the drupal site to the server I had a lot of performance problems in the server

And sometimes it made the server go down

Here is the host server specifications :

  • Operating system CentOS Linux 5.5
  • Webmin version 1.560
  • Kernel and CPU Linux 2.6.18-194.26.1.el5 on x86_64 Processor information Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz, 2 cores
  • Real memory 3.74 GB total, 2.35 GB used Virtual memory 4 GB total, 124 kB used
  • Local disk space 1.76 TB total, 147.63 GB used

Here is the basic apache setting :

  • Apache MPM Prefork
  • HostnameLookups Off
  • AllowOverride None
  • MaxClients 100
  • ThreadsPerChild 25
  • StartServers 8
  • MaxRequestsPerChild 4000
  • mod_deflate is enabled
  • mod_expires is enabled

Here is the basic php.ini settings:

  • safe_mode = on
  • max_execution_time = 1200
  • max_input_time = 1200
  • memory_limit = 1500M

Here is the mysql settings :

  • max_allowed_packet=3G
  • max_connections=200
  • wait_timeout=30
  • thread_cache=50
  • connect_timeout=30
  • query_cache_limit=1M
  • interactive_timeout=30

Here is the top cpu command result:

enter image description here

Here is the free -m and iostat commands result:

enter image description here

Here is the mysqladmin -u root -p ext -ri 30 | grep tmp_disk_tables command result:

  • | Created_tmp_disk_tables | 1771 |
  • | Created_tmp_disk_tables | 2 |
  • | Created_tmp_disk_tables | 5 |
  • | Created_tmp_disk_tables | 3 |
  • | Created_tmp_disk_tables | 7 |
  • | Created_tmp_disk_tables | 0 |

We installed : ffmpeg,gd libraries and zend optimizer

The cpu load average is always above 3

So anyone can help me with this ?

If you need any additional necessary information just ask in comments ?

3 Answers3

4

You have a 3.5 GB memory limit (memory_limit = 3500M), and are potentially starting 256 servers (MaxClients 256). This brings your total potential memory consumption to just under 900 GB. Unless you have that much RAM in the box, chances are good you're swapping, and that's what's causing your performance degradation.

You need to drastically dial back both of these numbers. I've never seen a 3.5 GB memory limit in half a decade of supporting Drupal. If you have an occasional task that requires a limit that high, it should probably be run on the command line, with drush, rather than through Apache.

What's the output of free -m? What about iostat (yum install sysstat if you don't have it)?

BMDan
  • 7,129
  • 2
  • 22
  • 34
  • Sorry for late response I'm having some problems accessing the server shell i'll try to fix it soon – Muhamad Bhaa Asfour Feb 15 '12 at 13:47
  • free -m result is `Mem: total: 830, used: 3334, free: 496, shared:0, buffers: 96, cached: 1801`======`-/+ buffers/cache: used: 1436, free: 2394`======`Swap: total: 4094, used: 19, free:4075` the iostate result is hard to write here in the comment box so how should i add it ? – Muhamad Bhaa Asfour Feb 15 '12 at 16:28
  • Some serious swappage! Add all information to the question... including the results of top – Abe Petrillo Feb 15 '12 at 19:59
  • Agree with BMDan that you need to dial down your MaxClients but from the data you provided it doesn't look like Apache is swapping. Find the average size of your Apache process and reduce MaxClients accordingly: http://serverfault.com/questions/353828/finding-average-size-of-single-apache-process-for-setting-maxclients – HTTP500 Feb 15 '12 at 20:30
  • @AbePetrillo do you mean you want the `iostate` results ? – Muhamad Bhaa Asfour Feb 15 '12 at 21:35
  • @M.B.Asfoor I mean instead of writing the info in comments update your question... for both iostat AND top – Abe Petrillo Feb 15 '12 at 22:23
  • @AbePetrillo everything you asked for is now in the question – Muhamad Bhaa Asfour Feb 16 '12 at 14:02
1

Some process is eating your CPU. To find what, do the following:

Type on the terminal:
top
Press Shift+P to order the list by CPU usage.

Check which process is consuming your cpu and or check how to deal with it, or post it here on the comments.

Leon Waldman
  • 132
  • 3
0

Drupal is highly relational. One thing that's common with it is the creation of temporary tables on disk. You want to minimize this if you can by optimizing the queries or putting the MySQL tmpdir on a RAM disk if you have to.

Run this:

mysqladmin -u root -p ext -ri 30 | grep tmp_disk_tables

First entry will tell you how many temporary tables were created on disk since last restart; after that how many were created during 30 second windows until you Ctrl-C out of it.

You also didn't say whether your Drupal tables were InnoDB or MyISAM in terms of MySQL configuration advice. In Drupal 6 it defaults to MyISAM.

HTTP500
  • 4,827
  • 4
  • 22
  • 31