TileDB-Py icon indicating copy to clipboard operation
TileDB-Py copied to clipboard

Control size of AwsEventLoop thread pool

Open adamrboxall opened this issue 7 months ago • 2 comments

Hi, I wonder if anyone can help with a configuration question around the AwsEventLoop thread pool associated with a TileDB context. It seems the size of this thread pool defaults to the number of physical cores on the machine (is this the case?), however in a multi-processing scenario and a HPC environment this can lead to a very large number of threads.

How can I configure the size of this thread pool, to reduce the number of threads?

Thanks very much!


Reproducible example:

(.venv) $ OMP_NUM_THREADS=1 python 
Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tiledb
>>> ctx = tiledb.default_ctx({"sm.io_concurrency_level": 1, "sm.compute_concurrency_level": 1})

Resulting threads on a machine with 32 physical cores:

Image

adamrboxall avatar May 15 '25 14:05 adamrboxall

Hi @adamrboxall, this is an AWS SDK default which we don't currently expose for configuration -- it appears to be controllable at SDK initialization, but we will need to investigate further to see if it can be plumbed through for configuration. (x-ref CORE-226).

ihnorton avatar May 28 '25 03:05 ihnorton

Makes sense, thanks very much @ihnorton , very helpful. Please keep us updated!

adamrboxall avatar Jun 02 '25 11:06 adamrboxall