I love chasing performance issues

Fisrt, what exactly operations you are doing ? What language is being used for these operations ? How big are the files, where do you see the timeouts, how powerful is your hardware ? What is your OS ?
Use "top" command to determine what's going on like :
"top -p PID-number, second-PID-number"
replace the PID-number with the respective PIDs of your scripts and you'll see where the resources are going.