Skip to content

Configuration: Linux Tuning LAMP

cpx October 24, 2008 2 min read GNU/Linux
<Directory />
    AllowOverride None
    Options FollowSymLinks
</Directory>

 

easuring performance

Listing 1. Using cURL to measure the response time of a Web site

$ curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total}\
    http://www.canada.com
0.081:0.272:0.779

Listing 2. /etc/sysctl.conf showing more aggressive network settings

# Use TCP syncookies when needed
net.ipv4.tcp_syncookies = 1
# Enable TCP window scaling
net.ipv4.tcp_window_scaling = 1
# Increase TCP max buffer size
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# Increase Linux autotuning TCP buffer limits
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
# Increase number of ports available
net.ipv4.ip_local_port_range = 1024 65000

Listing 3. A sample fstab showing how to enable noatime

/dev/VolGroup00/LogVol00 /                      ext3    defaults,noatime        1 1
LABEL=/boot             /boot                   ext3    defaults,noatime        1 2
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
sysfs                   /sys                    sysfs   defaults        0 0
LABEL=SWAP-hdb2         swap                    swap    defaults        0 0
LABEL=SWAP-hda3         swap                    swap    defaults        0 0

Listing 4. A speed test being performed on /dev/hda

# hdparm -t /dev/hda
/dev/hda:
 Timing buffered disk reads:  182 MB in  3.02 seconds =  60.31 MB/sec

Listing 5. Showing a NFS client’s RPC statistics

# nfsstat -rc
Client rpc stats:
calls      retrans    authrefrsh
1465903813   0          0

Tuning LAMP systems, Part 2: Optimizing Apache and PHP

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x