[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is there a limit on the count of the exported devices?



On Sat, Jan 04, 2020 at 09:20:40PM +0100, Vladimir Zhelezarov wrote:
> Hi,
> 
> independent of the size of the combined block device, I am unable to use more
> than 1018 devices with the "-m" option in nbd-server. So for example:
> 
> 
>     for i in {0..1999}; do truncate -s 1M mm.$i; done
>     sudo nbd-server -C /dev/null localhost@33333 -m /home/user/nbd/mm
>     sudo nbd-client localhost 33333 /dev/nbd0
> 
> 
> Then it says:
> 
>     Negotiation: ..size = 1018MB
>     bs=1024, sz=1067450368 bytes
> 
> which can also be confirmed by mounting /dev/nbd0.
> 
> 
> Another example with 5000 files of 500K gives:
> 
>     Negotiation: ..size = 497MB
>     bs=1024, sz=521216000 bytes
> 
> which gives the same 521216000/1024/500 = 1018 used files.
> 
> 
> The same happens when using different sizes or combinations of sizes and
> file-counts. I am using nbd 3.20 on x64 Ubuntu 18.04. Using a configuration
> file makes no difference. Different hardware with the same OS and nbd version
> neither.
> 
> 
> Can someone give me some pointers?

As you found out in the mean time, nbd-server doesn't impose a limit,
but the OS might.

The limits can be configured on Linux with "sysctl -w
fs.file-max=<number>", where you replace <number> by the number of files
you need (plus a small margin).

Thanks,

-- 
To the thief who stole my anti-depressants: I hope you're happy

  -- seen somewhere on the Internet on a photo of a billboard


Reply to: