LAMP System Performance Tuning for disk configuration (1)

Source: Internet
Author: User

 

Figure-LAMP

LAMPSystemOptimizationConfigurationDiskTo improve performance

A disk plays an important role in the LAMP architecture. Static files, templates, and codes are from disks. The data tables and indexes that make up the database also come from disks. Many Optimizations to disks (especially for databases) are concentrated to avoid disk access, because the disk access latency is quite high. Therefore, it makes sense to spend some time optimizing the disk hardware.

Make sure that the atime logging feature is disabled on the file system. Atime is the time when the file is recently accessed. when accessing the file, the underlying file system must record this timestamp. Because System Administrators seldom use atime, disabling it can reduce disk access time. To disable this feature, add the noatime option to the fourth column of/etc/fstab. Listing 3 provides a configuration example.

Listing 3. demonstrate how to enable the noatime fstab example

 
 
  1. /dev/VolGroup00/LogVol00 / ext3 defaults,noatime 1 1  
  2.  
  3. LABEL=/boot /boot ext3 defaults,noatime 1 2  
  4.  
  5. devpts /dev/pts devpts gid=5,mode=620 0 0  
  6.  
  7. tmpfs /dev/shm tmpfs defaults 0 0  
  8.  
  9. proc /proc proc defaults 0 0  
  10.  
  11. sysfs /sys sysfs defaults 0 0  
  12.  
  13. LABEL=SWAP-hdb2 swap swap defaults 0 0  
  14.  
  15. LABEL=SWAP-hda3 swap swap defaults 0 0  
  16.  

In listing 3, only the ext3 file system is modified, because noatime is only helpful for the file system residing on the disk. To make this change take effect, you do not need to reboot. You only need to reinstall each file system. For example, to reinstall the root file system, run mount/-o remount.

There are a variety of disk hardware combinations, and Linux may not be able to detect the best way to access and ask about disks. You can use the hdparm command to find and set the method for accessing the IDE disk. Hdparm-t/path/to/device executes the speed test. This test result can be used as the performance benchmark. To make the results as accurate as possible, the system should be idle when running this command. Listing 4 shows the results of performing a speed test on hda.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.