0

Linux xxx.xxx.xxx 2.6.18-128.1.6.el5 #1 SMP Wed Apr 1 09:19:18 EDT 2009 i686 i686 i386 GNU/Linux

Problems:

  • When I connect with SSH, each command take until 2 min to run!
  • Restart the server takes 16 minutes on average.
  • I have a web page in this server (PHP (Joomla) with Apache/2.2.8 (Unix) ) and each page takes 1 min in load.
  • I assumed it was because originally it was connected with IPv6, because when running the command "lsmod | grep v6" showed me the following:

ipv6 261473 125 xfrm_nalgo 13381 1 ipv6

But using this website (http://techno.mayix.net/deshabilitar-ipv6-en-redhatcentos/), I disable IPv6 connection because when running the command "lsmod | grep v6" showed me nothing. But the problems of slowness, still. - When I run the command top give me this:

top - 09:40:08 up 10 min,  1 user,  load average: 18.89, 14.99, 8.02
Tasks: 153 total,  13 running, 140 sleeping,   0 stopped,   0 zombie
Cpu(s): 57.1%us, 42.4%sy,  0.0%ni,  0.0%id,  0.0%wa,  0.2%hi,  0.3%si,  0.0%st
Mem:   1555380k total,   667200k used,   888180k free,    18332k buffers
Swap:  2048276k total,        0k used,  2048276k free,   193784k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                              
 2265 mysql     15   0  133m  23m 6052 S 35.8  1.5   2:43.58 mysqld                                                                                                               
 2868 apache    15   0 42092  21m 4520 S 18.2  1.4   0:19.51 httpd                                                                                                                
 3112 apache    16   0 41844  21m 4536 S 18.2  1.4   0:09.18 httpd                                                                                                                
 2506 apache    15   0 42108  21m 4516 S 17.9  1.4   0:23.15 httpd                                                                                                                
 3471 apache    16   0 41732  20m 4252 S 17.9  1.4   0:02.59 httpd                                                                                                                
 2567 apache    15   0 42060  21m 4496 S 16.9  1.4   0:20.84 httpd                                                                                                                
 2625 apache    16   0 41840  21m 4568 R 16.9  1.4   0:16.53 httpd                                                                                                                
 3461 apache    15   0 41460  20m 4260 S 16.6  1.4   0:02.17 httpd                                                                                                                
 2593 apache    15   0 42084  21m 4480 S 16.3  1.4   0:15.37 httpd                                                                                                                
 2429 apache    15   0 42040  21m 4484 S  9.8  1.4   0:14.31 httpd                                                                                                                
 3477 apache    18   0 36900  15m 3792 R  5.5  1.0   0:01.24 httpd                                                                                                                
 3499 apache    19   0 37432  16m 3840 R  3.3  1.1   0:01.40 httpd                                                                                                                
 2417 apache    15   0 40544  20m 4508 S  1.3  1.3   0:18.89 httpd                                                                                                                
 3520 root      15   0  2420 1060  800 R  1.3  0.1   0:00.46 top                                                                                                                  
 3464 apache    15   0 41332  20m 4432 S  0.7  1.4   0:04.03 httpd                                                                                                                
 2423 operador  15   0 10032 1596 1024 S  0.3  0.1   0:00.54 sshd                                                                                                                 
 2463 root      16   0  2052  636  556 S  0.3  0.0   0:01.84 hald-addon-stor                                                                                                      
 2482 apache    15   0 37224  16m 4508 S  0.3  1.1   0:17.95 httpd                                                                                                                
    1 root      15   0  2152  672  580 S  0.0  0.0   0:02.09 init                                                                                                                 
    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.10 migration/0                                                                                                          
    3 root      34  19     0    0    0 R  0.0  0.0   0:00.00 ksoftirqd/0                                                                                                          
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                                                                           
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.05 migration/1                                                                                                          
    6 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/1                                                                                                          
    7 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/1                                                                                                           
    8 root      10  -5     0    0    0 S  0.0  0.0   0:00.06 events/0                                                                                                             
    9 root      10  -5     0    0    0 S  0.0  0.0   0:00.04 events/1                                                                                                             
   10 root      10  -5     0    0    0 S  0.0  0.0   0:00.03 khelper                                                                                                              
   11 root      14  -5     0    0    0 S  0.0  0.0   0:00.02 kthread                                                                                                              
   15 root      10  -5     0    0    0 S  0.0  0.0   0:00.08 kblockd/0                                                                                                            
   16 root      10  -5     0    0    0 S  0.0  0.0   0:00.05 kblockd/1                                                                                                            
   17 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid                                                                                                               
   74 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0                                                                                                             
   75 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/1                                                                                                             
   78 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 khubd                                                                                                                
   80 root      14  -5     0    0    0 S  0.0  0.0   0:00.03 kseriod                                                                                                              
  146 root      19   0     0    0    0 S  0.0  0.0   0:00.00 pdflush                                                                                                              
  147 root      15   0     0    0    0 S  0.0  0.0   0:00.50 pdflush                                                                                                              
  148 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 kswapd0                                                                                                              
  149 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0                                                                                                                
  150 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 aio/1                                                                                                                
  305 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused                                                                                                            
  349 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 mpt_poll_0                                                                                                           
  350 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0                                                                                                            
  354 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 ata/0                                                                                                                
  355 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 ata/1                                                                                                                
  356 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 ata_aux                                                                                                              
  363 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 kstriped                                                                                                             
  376 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 ksnapd 

When I run "cat /etc/resolv.conf", in my server, showed me this:

nameserver xxx.xxx.xxx.1 domain mydomain.com

And when I run "ping mydomain.com", in my pc, showed me this:

"Pinging mydomain.com [xxx.xxx.xxx.5] with 32 bytes of data:"

4
  • 1
    try running free -m from the console and see how much RAM you've left Commented Dec 3, 2010 at 17:51
  • free -m showed me this: total used free shared buffers cached Mem: 1518 657 861 0 32 291 -/+ buffers/cache: 333 1185 Swap: 2000 0 2000
    – Galled
    Commented Dec 3, 2010 at 17:54
  • Please update your kernel to the latest version. The one you are running has a trivial root exploit vulnerability, and anyone who finds a flaw in your web site could then easily compromise the entire system. And then "it's slow" will be the less interesting of your problems....
    – mattdm
    Commented Dec 4, 2010 at 22:01
  • Bone in the end the solution was to change the OS. XD
    – Galled
    Commented Apr 16, 2011 at 0:07

5 Answers 5

2

Looks like mysql and apache are chewing up a lot of processing time. The database could be a bottleneck, I am assuming that you really need it - could you profile your db usage and see what is going on?

1
  • Yeah — system load is high, and the system is doing stuff. The problem may be at the application level — from the system point of view, if it's busy and working as hard as it can, the only problem is that the machine is undersized for the load.
    – mattdm
    Commented Dec 4, 2010 at 22:09
1

The load average of 18 clearly indicates a problem, but the question is, why is it so high?

I had a very similar problem a while back and it turned out to be an issue with the disk controller. Very slow disk access was causing the system to bottleneck while waiting for disk IO (which showed up as very high load averages and wait times, but also cause processes waiting for disk to consume more CPU than they would otherwise. It turned out that the kernel wasn't recognizing the controller properly and was falling back onto the old school IDE controller instead of a fast sata one.

The fix was to boot with

hda=noprobe hda=none 

at the end of the kernel string in /etc/grub.conf.

If the issue isn't disk IO, then you'll have to spend some time troubleshooting what it is. From the output you've got so far, it looks like you have plenty of RAM, but CPU is being consumed by httpd and mysql processes. Is your server legitimately busy? How many connections are coming into the server? (You can get this information with netstat -an |grep ESTABLISHED and if that is too many to count you can do netstat -an |grep ESTABLISHED |wc -l to count the lines.) You can also use a tool like iostat to look at disk io statistics (from the sysstat package: yum install sysstat to install it).

0

I would check mysql performance using mysqltuner.pl and also check SMART disk for errors.

And, try to use innodb engine configuration like described here. Mind the innodb_buffer_pool_size variable. It does magic.

0

I don't think disk is the problem; most of your processor allocation is in userspace(57.1%us) or in system calls(42.4%sy) and not waiting on disk I/O(0.0%wa).

Instead, I would watch what your apache backend and database queries are doing and see if you can trim any fat there. To answer what apache is doing, I would enable mod_status, gracefully restart apache, and then visit http://server_name/server-status. For MySQL, I would log onto the mysql administration console and then show full processlist;

0

I talk to an administrator of the server. He has replaced the entire virtual machine Centos 32-bit to a "Ubuntu Sever 10.10" and has installed the apache in worker mode and fast-cgi php.

Finally this was the solution.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .