It's difficult to provide a definitive answer without more information about the specific tasks and code you are running within your loop. However, I can provide some general insights and suggestions that might help you optimize resource usage in your scenario.
CPU Usage: If your loop tasks are computationally intensive, it's expected that they will consume a significant amount of
Intel NUC resources. However, you mentioned that the tasks are reading from a database and writing to a file, which typically shouldn't be overly CPU-intensive operations. It's possible that there could be other factors contributing to the high CPU usage, such as inefficient code or resource contention. Analyzing and profiling your code can help identify any performance bottlenecks.
Resource Allocation: The resource usage of a loop can be affected by various factors, including the number of iterations, the complexity of each iteration, and the resource requirements of the tasks within the loop. Considering your hardware specifications, you have limited CPU power (2GHz dual-core) and 8GB of RAM, which might impact performance if the tasks require more resources than what is available.
System