Currently the MultiThreadedExecutor just uses the number of hardware cores/threads as the number of threads to use: https://github.com/ros2/rclcpp/blob/master/rclcpp/src/rclcpp/executors/multi_threaded_executor.cpp#L29
It would be useful for it to be optionally configurable through an argument to the constructor so that one can effectively limit the maximum resource usage, much like how this could be done with nodelets in the past.