On Sunday 23 January 2005 11:54, Christian Wicke wrote:
> Hello,
>
> I experience a huge performance loss when I run my programms inside a
> UML-child. Creating 1,000 files took eighteen times as long as on the
> UML-host.

> A simple shell script to count up to 100,000 took three times as long.

> Is this normal?
More or less... you don't describe your environment, from the host config I 
guess it's SKAS however... Do you set TMPDIR to a tmpfs or ramfs mount point? 
Without those tricks, any test is pointless.

Creating a process inside UML takes a lot longer of the host... try to rewrite 
the scripts in perl or C, or any scripting language, and you'll see that the 
difference reduce a lot.

The problem is that starting the "touch" process is a lot slower than creating 
the file itself! Try this:

$ > a

to create that file, and times will probably improve (I'm not sure, since 
probably the shell forks anyway to execute a command, so we loose anyway)... 
On the other side, you'd get a 18x difference even if you ran a loop with of 
100.000 /bin/echo... or maybe in that case the difference would be even 
bigger.

In many real workloads, however, things are a lot better... pure userspace 
computation, without page faults, sees no difference inside UML vs. inside 
the host, and a kernel compilation gives only something littler than 2x as 
slowdown ratio... (I don't have even a order of figures about this, there was 
something in the list)...
> I run debian sarge with Linux 2.6.8 with skas-patch on the host and debian
> woody with Linux 2.4.25 for the uml-guest. The configuration files are
> attached.

> Host and guest use reiserfs. The guest has a lvm-device as UDB; so writing
> should only go through the filesystem layer of the guest.

No, until you use UBD you also go through the block device layer (the UBD 
driver is not different from a IDE driver, it only uses the host VFS instead 
of playing with hardware). That's not the problem, however.

> I checked what overhead causes lvm: It is less than 10%, so this is not the
> problem.
> Swapping isn't the problem either. The host uses almoust no swap-memory.
You should check for the guest too, but I have no reason to think the guest is 
swapping.
>
> Creating 1000 files:
> UML-host:
> # time ./test_create_file.sh
>
> real    0m1.761s
> user    0m0.577s
> sys     0m1.145s
>
> UML-guest:
> # time ./test_create_file.sh
>
> real    0m32.769s
> user    0m2.970s
> sys     0m29.750s
>
> #cat test_create_file.sh
> x=1; while [ $x -le 1000 ]; do x=$((x+1)); touch file_$x; done
>
> Counting to 100000:
> UML-host:
> # time ./test_count.sh
>
> real    0m2.780s
> user    0m2.716s
> sys     0m0.059s
>
> UML-guest:
> # time ./test_count.sh
>
> real    0m8.675s
> user    0m7.510s
> sys     0m1.180s
>
> # cat test_count.sh
> x=1; while [ $x -le 100000 ]; do x=$((x+1)); done

> I start the UML-guest with
> /usr/bin/SCREEN -d -m -- su -c HOME=/var/local/afprod2  /opt/uml/bin/linux
> mem=222M umid=afprod2 eth0=tuntap,tap12 ubd0=/dev/mapper/vg1-afprod2
> con0=fd:0,fd:1 con=pts afprod2

-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to