Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I was wondering if IO through a symbolic link affects IO on the host drive even if it points to a seperate drive? My setup is,

/dev/sdb2       1.8T  443G  1.3T  26% /home1
/dev/sda3       1.8T  1.7T   44G  98% /home

With symbolic links poiting /home/$users to /home1/$users (about 50 links, with constant IO streams to /home/*), will this affect the IO at all on sda3 (/home/), as you can see sda3 needs all the IO to itself, with 98% full and high load (34% iowait :/) So, with 34% iowait, would removing the symlinks and querying /home1/ directly go anywhere to decreasing my iowait?

Linux 3.2.13-grsec-xxxx-grs-ipv6-64 (sb7)       17/10/12        _x86_64_        (8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.27    0.00    2.87   31.50    0.00   64.36

Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util
sda             110.61   471.54  167.28   18.98 11076.29  1964.83   140.04     8.35   44.30   23.27  229.66   5.36  99.78
sdb               0.38     0.75   80.00    5.16  4227.02  2143.14   149.59     1.99   23.38   10.69  219.99   3.26
share|improve this question
    
Well, every time that a home directory is accessed with its full path, there will be one lookup on the /dev/sda3. –  January Oct 15 '12 at 16:21
    
Sounds like you should be using raid and/or LVM –  psusi Oct 15 '12 at 19:02
    
Nope, can't afford a RAID hardware controller and the software RAID (which used to merge sda and sdb into one /home/) seriously hurt the performance, so I went with this symlinking option, so that the system has direct access to the disks. They're under constant heavy usage as you can see. –  King Oct 15 '12 at 19:38

1 Answer 1

up vote 4 down vote accepted

Its possible, but very unlikely.

Basically, the way a symbolic link works is that during pathname resolution, the kernel reads the symbolic link, and uses it to rewrite the pathname. So each time the kernel resolves a path through it, it theoretically reads the symlink. And also all the directories up to it. But in practice, its always in the cache, so none of those reads hit the disk.

Its possible—I'm not sure, really—if that causes an atime update. If it does, and you're not running with relatime or noatime, then those writes could add a fair bit of load. If you're running with full atime updates, I recommend at least switching to relatime if at all possible. That probably will help your I/O load. See the mount(8) manpage for details.

share|improve this answer
    
How do I tell if I have realtime/noatime? I don't have a realtime kernel installed, I've got the Ubuntu Server 12.04 LTS 64bit default, whatever Kernel that uses. man mount(8) dosen't work, and man mount dosen't mention realtime :/ –  King Oct 15 '12 at 19:31
    
Not realtime, relatime (rel ative + atime). The man command is man 8 mount. Its a flag that would be set in /etc/fstab. You can check /proc/mounts to see what is currently there. –  derobert Oct 15 '12 at 20:38
    
/dev/sdb2 /home1 ext4 rw,relatime,errors=remount-ro,user_xattr,acl,barrier=1,data=ordered 0 0 /dev/sda3 /home ext3 rw,relatime,errors=continue,barrier=1,data=writeback 0 0 I've got realtime, so it wont affect my IO? –  King Oct 16 '12 at 21:29
    
@King yep. If you need to speed up I/O to that drive, your approaches are RAID, moving more data off it, buying a faster disk (e.g., 15K rpm or flash) and—if there is a noticeable write component, and you are confident the power will never be pulled and the system will never crash and/or don't care about data loss—barrier=0. I suggest a new question if you want to work on that. Make sure to include at least some iostat output... –  derobert Oct 17 '12 at 3:56
1  
@King RAID—software or hardware—can be faster or slower, depends on which RAID level you're using. With a write-heavy load, RAID1 (mirror) will probably be slower. RAID10 (if you have the disks) is nice. RAID0 will almost certainly be faster (but less reliable). Please ask a new question... –  derobert Oct 17 '12 at 16:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.