LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2013, 06:37 PM   #1
iLinux85
LQ Newbie
 
Registered: Mar 2010
Posts: 3

Rep: Reputation: 0
Apache configuration performance tuning


My Server build on centos 5.9 (final) 64 Bit , the ram 64 G.B and i have excessive load

here is my top



Code:
    top - 11:41:52 up 1 day,  3:28,  2 users,  load average: 38.35, 36.29, 35.49
    Tasks: 486 total,  26 running, 459 sleeping,   0 stopped,   1 zombie
    Cpu(s): 71.6%us, 13.5%sy,  0.0%ni, 14.6%id,  0.2%wa,  0.0%hi,  0.2%si,  0.0%st
    Mem:  65962840k total, 21219004k used, 44743836k free,   425172k buffers
    Swap:  4184924k total,        0k used,  4184924k free, 15858548k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    16444 mysql     15   0 1053m 377m 4700 S 170.7  0.6 796:42.63 mysqld
    31008 nobody    15   0  243m  48m 5904 S  1.6  0.1   0:59.57 httpd
    13645 nobody    15   0  241m  47m 5400 S  2.0  0.1   0:51.54 httpd
    18968 nobody    15   0  241m  47m 5412 S  2.3  0.1   0:41.72 httpd
     5048 root      15   0  151m  47m 2816 S  0.0  0.1   0:05.18 /usr/local/cpan
     6312 nobody    16   0  241m  47m 5416 R  6.6  0.1   0:30.86 httpd
    31493 nobody    15   0  241m  47m 5408 S  2.3  0.1   1:00.88 httpd
    19157 nobody    15   0  241m  47m 5412 S  5.6  0.1   0:45.52 httpd
    12505 nobody    15   0  240m  47m 5800 S  2.0  0.1   0:22.87 httpd
    19170 nobody    15   0  241m  47m 5440 S  2.3  0.1   0:45.46 httpd
      435 nobody    15   0  241m  47m 5404 S  4.3  0.1   0:04.80 httpd
    20072 nobody    16   0  241m  47m 5444 R  3.6  0.1   0:44.53 httpd
     6335 nobody    15   0  239m  47m 4960 S  3.9  0.1   0:29.19 httpd
    19154 nobody    15   0  239m  47m 4964 S  2.3  0.1   0:43.26 httpd
     6315 nobody    15   0  239m  47m 4964 S  4.3  0.1   0:28.54 httpd
      535 nobody    16   0  239m  47m 4956 S  2.0  0.1   0:04.11 httpd
      690 nobody    15   0  239m  46m 4944 S  6.2  0.1   0:04.14 httpd
      575 nobody    16   0  239m  46m 4944 R  6.2  0.1   0:04.05 httpd
      703 nobody    15   0  239m  46m 4944 S  3.3  0.1   0:03.93 httpd
    20073 nobody    15   0  240m  46m 5416 S  4.6  0.1   0:44.02 httpd
    31540 nobody    15   0  238m  46m 5000 S  4.3  0.1   0:57.52 httpd
      702 nobody    15   0  238m  46m 4992 S  3.9  0.1   0:03.97 httpd
     1354 nobody    15   0  238m  46m 4992 S  2.3  0.1   0:03.18 httpd
     5064 root      18   0  151m  46m 1216 S  0.0  0.1   0:00.01 spamd child
     5065 root      18   0  151m  46m 1216 S  0.0  0.1   0:00.01 spamd child
     4648 nobody    15   0  236m  44m 4904 S  3.9  0.1   0:00.87 httpd
    26090 nobody    16   0  227m  32m 5160 R  6.9  0.1   0:09.02 httpd
     4265 nobody    16   0  221m  28m 4492 R  7.2  0.0   0:00.60 httpd
    15114 nobody    16   0  221m  28m 4660 R  5.9  0.0   0:21.02 httpd
    22732 nobody    16   0  224m  32m 4664 R 17.7  0.0   0:39.38 httpd
    19217 nobody    15   0  219m  24m 5192 R 14.2  0.0   0:15.71 httpd
    20355 nobody    16   0  216m  24m 4644 R  8.9  0.0   0:15.01 httpd
     6212 nobody    15   0  217m  23m 5176 S  7.1  0.0   0:28.73 httpd
     6299 nobody    16   0  217m  23m 5196 S  3.5  0.0   0:29.43 httpd
      537 nobody    16   0  217m  23m 5168 S 12.4  0.0   0:03.51 httpd
     2313 nobody    15   0  217m  23m 5216 S  1.8  0.0   0:02.45 httpd
     1266 nobody    15   0  217m  23m 5176 S  0.0  0.0   0:03.06 httpd
     6662 nobody    16   0  216m  22m 5644 S  7.1  0.0   0:55.94 httpd
    11828 nobody    16   0  216m  22m 5700 S  0.0  0.0   0:24.54 httpd
an my apache connections
Code:
    # netstat -ant | grep 80 | wc -l
    4156

my sysctl.conf


Code:
    # cat /etc/sysctl.conf
    # Kernel sysctl configuration file for Red Hat Linux
    #
    # For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
    # sysctl.conf(5) for more details.
    
    # Controls IP packet forwarding
    net.ipv4.ip_forward = 0
    
    # Controls source route verification
    net.ipv4.conf.default.rp_filter = 1
    
    # Do not accept source routing
    net.ipv4.conf.default.accept_source_route = 0
    
    # Controls the System Request debugging functionality of the kernel
    kernel.sysrq = 0
    
    # Controls whether core dumps will append the PID to the core filename
    # Useful for debugging multi-threaded applications
    kernel.core_uses_pid = 1
    
    # Controls the use of TCP syncookies
    net.ipv4.tcp_syncookies = 1
    
    # Controls the maximum size of a message, in bytes
    kernel.msgmnb = 65536
    
    # Controls the default maxmimum size of a mesage queue
    kernel.msgmax = 65536
    
    # Controls the maximum shared segment size, in bytes
    kernel.shmmax = 68719476736
    
    # Controls the maximum number of shared memory segments, in pages
    kernel.shmall = 4294967296
    
    
                 # Decrease the time default value for tcp_fin_timeout connection
                 net.ipv4.tcp_fin_timeout = 30
                 # Decrease the time default value for tcp_keepalive_time connection
                 net.ipv4.tcp_keepalive_time = 1800
                 # Turn off the tcp_window_scaling
                 net.ipv4.tcp_window_scaling = 0
                 # Turn off the tcp_sack
                 net.ipv4.tcp_sack = 0
                 # Turn off the tcp_timestamps
                 net.ipv4.tcp_timestamps = 0

Apache configuration , **i do not know if the configuration made well for the server resources or not**

Code:
    KeepAlive Off
    MaxKeepAliveRequests 50
    KeepAliveTimeout 1
    MinSpareServers 5
    MaxSpareServers 10
    StartServers 5
    MaxClients 256
    MaxRequestsPerChild 1000

apache consume memory

Code:
    # ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
    Tot=5988696(258)
    Avg=5988696/258=22.668MB

Code:
# netstat -ant | grep 80 | awk '{print $6}' | sort | uniq -c | sort -n
      1 LISTEN
      6 FIN_WAIT1
     14 LAST_ACK
     17 FIN_WAIT2
     77 CLOSE_WAIT
    135 ESTABLISHED
    487 SYN_RECV
   5350 TIME_WAIT
 
Old 05-25-2013, 08:30 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
This may be worth a look http://slack-linux.blogspot.com.au/2...ate-codes.html
Anyway, the DB is hogging the system, caused by the httpd processes in the 'R' state.
You need to use the mysql tools and logs to see what its trying to do.
You should also investigate what SQL the httpd processes are calling.
Could be as simple as a lack of appropriate indexes on the tables, or the indexes not being used by the SQL.
 
Old 05-27-2013, 01:13 AM   #3
bloodstreetboy
Member
 
Registered: May 2012
Posts: 198
Blog Entries: 3

Rep: Reputation: 37
If you are talking about apache performance tuning
Have you read this
http://httpd.apache.org/docs/2.2/misc/perf-tuning.html
 
  


Reply

Tags
apache, centos, tuning


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance tuning of apache malay_biswal Linux - Server 1 10-06-2011 08:35 PM
Performance tuning questions gosssamer Linux - Server 5 09-13-2011 02:35 PM
MySQL - Performance Tuning Firebar Linux - Server 4 12-24-2008 01:16 PM
Performance Tuning Question? toddbailey Linux - Server 1 09-14-2007 03:00 PM
apache performance tuning sachin1361 Linux - Enterprise 1 03-05-2007 07:19 AM


All times are GMT -5. The time now is 04:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration