Hi Waldek,

I think the slowness comes because cpiod reports each file on the stdout. 
Could you try to comment-out the logging in cpiod and try if it works 
faster?
So if you open two terminals and in the first one run:

```
$ capstan run demo --execute "/tools/cpiod.so --prefix /zfs/zfs" -f 
10000:10000
```

Then in another terminal run:

```
$ capstan package compose-remote localhost
```

Capstan will start uploading. But if you look at the first terminal, then 
you will notice that each file is printed to console, e.g.:

```
$ capstan run demo --execute "/tools/cpiod.so --prefix /zfs/zfs" -f 
10000:10000
Command line will be set based on --run parameter
Created instance: demo
Setting cmdline: /tools/cpiod.so --prefix /zfs/zfs
OSv v0.24-448-g829bf76
eth0: 192.168.122.15
Waiting for connection from host...

Adding /tools/cpiod.so...  # 
<------------------------------------------------------------------------ 
PROBLEMATIC OUTPUT, SHOULD BE SUPPRESSED
Adding /bin...
Adding /bin/libnode-4.4.5.so...
Adding /run/interpreter...
Adding /run/sleep...
Adding /server.js...
Adding /usr...
Adding /zpool.so...
Adding /etc...
Link /node to /bin/libnode-4.4.5.so ...
Adding /run/burek...
Adding /run/node...
Adding /tmp...
Adding /run...
Adding /tools...
Adding /libzfs.so...
Adding /zfs.so...
Adding /run/hello...
Adding /tools/mkfs.so...
Adding /etc/fstab...
Link /etc/mnttab to /proc/mounts ...
Adding /greeting.js...
Adding /libenviron.so...
Adding /libuutil.so...
Adding /bin/sleep.so...
Adding /proc...
Adding /bin/cd.so...
Adding /etc/hosts...
Adding /usr/lib...
Adding /dev...
Adding /usr/lib/libgcc_s.so.1...
...
```

Please let me know if suppressing this log speeds up the process, I never 
had time to play with this myself, but I'm very curious :)



Best Regards,
Miha




Dne Ĩetrtek, 02. november 2017 21.16.37 UTC+1 je oseba Waldek Kozaczuk 
napisala:
>
> I think this might be a well known and undestood issue by capstan team but 
> I wanted to uderstand why it happens for my own sake. 
>
> In my scenario I am usually able to upload 300 of files totaling 60MB in 
> 10-12 seconds (Java app) using capstan which I believe employs same 
> mechanism as OSv build script (over a socket to cpiod). On other hand when 
> I upload 13,000 small JS files (node app) totalling around 100MB it takes 
> at least 3 minutes (when I use VirtualBox to run OSv instance I am 
> uploading to it takes over 10 minutes). Both capstan and ODv I am uploading 
> to run on the same machine. 
>
> Why is the upload of small files at least 10 times slower than with bigger 
> files? Is it because ZFS is not most efficient handling small files? Is it 
> possibly of how the upload is implemented on capstan side?
>
> Any ideas how to speed it up? Would somehow compressing all files in one 
> archive and uploading to cpiod as one tarball and then decompressing help?
>
> Regards,
> Waldek
>
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to