Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7693941
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: 系统运维

2005-05-24 20:09:30

也是加速Squid的

I have found four simple ways to improve UFS performance for Squid. Some of these are specific to certain operating systems, such as BSD and Linux, and may not be available on your platform:

  • Some UFS implementations support a noatime mount option. Filesystems mounted with noatime don't update the inode access time value for reads. The easiest way to use this option is to add it to the /etc/fstab like this:

    # Device            Mountpoint    FStype  Options        Dump    Pass#

    /dev/ad1s1c /cache0 ufs rw,noatime 0 0
  • Check your mount(8) manpage for the async option. With this option set, certain I/O operations (such as directory updates) may be performed asynchronously. The documentation for some systems notes that it is a dangerous flag. Should your system crash, you may lose the entire filesystem. For many installations, the performance improvement is worth the risk. You should use this option only if you don't mind losing the contents of your entire cache. If the cached data is very valuable, the async option is probably not for you.

  • BSD has a feature called soft updates. Soft updates are BSD's alternative to journaling filesystems.[1] On FreeBSD, you can enable this option on an unmounted filesystem with the tunefs command:

    For further information, please see "Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast File System" by Marshall Kirk McKusik and Gregory R. Ganger. Proceedings of the 1999 USENIX Annual Technical Conference, June 6-11, 1999, Monterey, California.

    # umount /cache0

    # tunefs -n enable /cache0

    # mount /cache0
  • You only have to run the tunefs once for each filesystem. Soft updates are automatically enabled on the filesystem again when your system reboots.

    On OpenBSD and NetBSD, you can use the softdep mount option:

    # Device            Mountpoint    FStype  Options        Dump    Pass#

    /dev/sd0f /usr ffs rw,softdep 1 2
阅读(2667) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~