Can a node run more than on _optimize concurrently?

I'm sending a REST call to optimize several indices together:

127.0.0.1:9200/index1,index2,index3/_optimize?max_num_segments=1&force=true

looking at the segments on disk, it is evident that the node optimizes one index at a time (finishes the rist, and then starts the next).
More than that, it sometimes optimizes 1-3 indices and then stops.

Is there a way to tell the node to optimize several indices concurrently? (the machine has 16 CPUs)

Regards,
Eran

when sending an optimize request, it optimizes one shard at a time on a node. It gets executed on an optimize thread pool, and the thread pool is configured with size set to 1. This is intentional in order not to overload a node with heavy optimizations going on while other operations are happening, it also means there is less concurrent load IO wise (not CPU).

You can change the optimize thread pool to have more than 1 thread, by setting threadpool.optimize.size : 2 in the config, but this is typically not needed and might get different optimizations to throttle each other.

Great.

Thanks for the quick answer!

Eran.