Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

share|improve this question
    
Can you paste the third line of top? The one with a bunch of two-letter words and percentages. –  lunixbochs Feb 15 '12 at 19:58
    
ThreadsPerChild is only applicable if you are using Worker MPM. –  HTTP500 Feb 15 '12 at 20:27
    
@lunixbochs the third top is apache 4.0% –  M.B.Asfoor Feb 15 '12 at 21:34
    
@HTTP500 ok thank you –  M.B.Asfoor Feb 15 '12 at 21:35
    
no @M.B.Asfoor - not the third process, the third status line in the area above the processes. Starts with "Cpu(s)" for me. –  lunixbochs Feb 15 '12 at 21:52
add comment

3 Answers

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

share|improve this answer
    
Sorry for late response I'm having some problems accessing the server shell i'll try to fix it soon –  M.B.Asfoor 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 ? –  M.B.Asfoor 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: serverfault.com/questions/353828/… –  HTTP500 Feb 15 '12 at 20:30
    
@AbePetrillo do you mean you want the iostate results ? –  M.B.Asfoor Feb 15 '12 at 21:35
show 3 more comments

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.

share|improve this answer
    
Sorry for late response I'm having some problems accessing the server shell i'll try to fix it soon –  M.B.Asfoor Feb 15 '12 at 13:51
    
I got mysql 22.9% then root 9.0% then apache 4.0% –  M.B.Asfoor Feb 15 '12 at 16:18
add comment

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.

share|improve this answer
    
Table are InnoDB because i'm using pressflow –  M.B.Asfoor Feb 15 '12 at 21:28
    
I'll try this as soon as possible because my server is down now :( –  M.B.Asfoor Feb 15 '12 at 21:46
    
The command result is in the question –  M.B.Asfoor Feb 20 '12 at 13:14
    
I edited the maxClients it's now 100 and the memory_limit is now 1500M –  M.B.Asfoor Feb 20 '12 at 14:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.