[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    Re: [fuse-devel] Bottleneck when using fuse_loop() instead
From:       Miklos Szeredi <miklos () szeredi ! hu>
Date:       2007-10-08 19:35:07
Message-ID: E1IeyNf-0005VV-00 () dorka ! pomaz ! szeredi ! hu
[Download RAW message or body]

> Fuse_loop() seems to cause the following suboptimal behavior: if a
> FUSE operation such as ops.readdir is taking a long time, all other
> calls to the FUSE filesystem are stalled until the slow operation
> completes. This can be verified by simulating a slow network:
> 
> 1) Create a slow version of FUSE's hello.c example by adding a
> sleep(10) in hello_readdir(). I've attached this as hello_slow.c .
> 2) Run "mkdir /tmp/slow_network/; ./hello_slow /tmp/slow_network/" .
> 3) Make a version of FUSE's fusexmp.c example that uses fuse_loop()
> instead of fuse_main(). I've attached this as fusexmp_loop.c .
> 4) Run "mkdir /tmp/xmp_loop/; ./fusexmp_loop /tmp/xmp_loop/" .
> 5) Have two terminals open. In one terminal type "ls
> /tmp/xmp_loop/tmp/slow_network", and immediately thereafter in the
> other terminal type "ls /tmp/xmp_loop". Notice that "ls /tmp/xmp_loop"
> only finishes after "ls /tmp/xmp_loop/tmp/slow_network", even though
> "ls /tmp/xmp_loop" should be fast.
> 
> Compare this to the proper behavior of fuse_main() as used in
> fusexmp.c:
> 
> 1) Run "mkdir /tmp/xmp/; ./fusexmp /tmp/xmp/" .
> 2) Have two terminals open. In one terminal type "ls
> /tmp/xmp/tmp/slow_network", and immediately thereafter in the other
> terminal type "ls /tmp/xmp". Notice that "ls /tmp/xmp" finishes before
> "ls /tmp/xmp/tmp/slow_network".
> 
> Is there any way to avoid these slow bottlenecks when using
> fuse_loop()?

With the high level lib, the only way to solve this is by having
multiple parallel threads.  You can do that by using fuse_loop_mt()
instead of fuse_loop().

If multi-threading is out of the question, then the other possibility
is to use the low level interface, and implement a custom event loop
with poll() or select().

Miklos

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic