On my OS (Mac 14.6 - Mojave), the limit is only 256!
$ launchctl limit maxfiles
maxfiles 256 unlimited
This is far to little for merging terrain-tiles over a moderate area.
Building the raster in pieces could work but maybe creating a vrt as the intermediate step would work better.
When merging, rasterio is subject to the OS's "limit on open file descriptors" https://github.com/mapbox/rasterio/issues/1636
On my OS (Mac 14.6 - Mojave), the limit is only 256!
This is far to little for merging terrain-tiles over a moderate area. Building the raster in pieces could work but maybe creating a vrt as the intermediate step would work better.