LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Operation System tuning for web server performance

To: "lvs-users" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Operation System tuning for web server performance
From: "Biapple" <biappaib@xxxxxxx>
Date: Sun, 20 Mar 2005 21:10:43 +0800
lvs-users,

        Hello!
        I'll evaluate the performance of a web server, in order to make a 
constrast, 
I want to tune the parametres of OS, such as file system, virtual memory, 
network
protocol suite and so like. I found a guide manual with googling and did some 
tuning,
but, disappointedly, I found the performance became worse. Who can tell me why 
and
send me detail information on the tuning? 
        I fail to find adequate place to post the message, and I think there 
are some
master-hand, any advice will welcome.
        Thank you in advance!

Tuned conf file:
---------------------------------------------------------------------------------------
/boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-3)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-3 ro root=/dev/hda2 elevator=deadline
        initrd /initrd-2.4.18-3.img
---------------------------------------------------------------------------------------
/etc/fstab
#LABEL=/                 /                       ext3    defaults        1 1
LABEL=/                 /                       ext3    noatime,defaults 1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
---------------------------------------------------------------------------------------
/etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) for
# more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# 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

# for web performance, added by Wengui YANG
# TCP optimization
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv = 3
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
# vm optimization
vm.lower_zone_protection = 100
-------------------------------------------------------------------------------------
The following two lines were added into "/etc/rc.d/init.d/functions"
ulimit -n 65535 >/dev/null 2>&1
ulimit -u 16384 >/dev/null 2>&1
-------------------------------------------------------------------------------------
The following items in "/etc/httpd/conf/httpd.conf" were changed:
# Timeout: The number of seconds before receives and sends time out.
#
#Timeout 300
Timeout 60
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
#KeepAlive Off
KeepAlive On
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
#MaxKeepAliveRequests 100
MaxKeepAliveRequests 150
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
#KeepAliveTimeout 15
KeepAliveTimeout 5
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
#
#MinSpareServers 5
#MaxSpareServers 20
MinSpareServers 50
MaxSpareServers 250
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
#MaxClients 150
MaxClients 1000
#UseCanonicalName On
UseCanonicalName Off
#ServerSignature On
ServerSignature Off

                                

        Biapple
        biappaib@xxxxxxx
          2005-03-20




<Prev in Thread] Current Thread [Next in Thread>