diff --git a/docs/mosaic.md b/docs/mosaic.md index a3bff278..2f3682bd 100644 --- a/docs/mosaic.md +++ b/docs/mosaic.md @@ -31,7 +31,7 @@ rio_tiler.mosaic.mosaic_reader( *args: Any, pixel_selection: Union[Type[MosaicMethodBase], MosaicMethodBase] = FirstMethod, chunk_size: Optional[int] = None, - threads: int = MAX_THREADS, + threads: int = RIO_TILER_MAX_THREADS, allowed_exceptions: Tuple = (TileOutsideBounds,), **kwargs, ) @@ -127,14 +127,14 @@ mosaic_assets = ["1.tif", "2.tif", "3.tif", "4.tif", "5.tif", "6.tif"] for chunks in _chunks(mosaic_assets, chunk_size): # 2nd level loop - Uses threads for process each `chunck` - with futures.ThreadPoolExecutor(max_workers=max_threads) as executor: + with futures.ThreadPoolExecutor(max_workers=RIO_TILER_MAX_THREADS) as executor: future_tasks = [(executor.submit(_tiler, asset), asset) for asset in chunks] ``` By default the chunck_size is equal to the number or threads (or the number of assets if no threads=0) #### More on threading -The number of threads used can be set in the function call with the `threads=` options. By default it will be equal to `multiprocessing.cpu_count() * 5` or to the `MAX_THREADS` environment variable. +The number of threads used can be set in the function call with the `threads=` options. By default it will be equal to `multiprocessing.cpu_count() * 5` or to the `RIO_TILER_MAX_THREADS` environment variable. In some case, threading can slow down your application. You can set threads to `0` or `1` to run the tiler in a loop without using a ThreadPool (ref: [#207](https://github.com/cogeotiff/rio-tiler/issues/207)). Benchmark: