# why does it take long for the bash prompt to return on high system load [closed]

When my server experiences high load and I run a command, there is a long delay after the command has finished before I get the prompt again. Any idea what is causing this?

-

## closed as too localized by Caleb, Stéphane Gimenez, Mat, Tim Kennedy, jw013Sep 27 '12 at 18:02

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Why is anything slow when there's high load? It's a game of chase the bottleneck. There's no magic bullet answer. –  bahamat Aug 14 '12 at 9:09
I mean it literally takes minutes to print the prompt. The actual command has finished executing (e.g. a cat printed the last line). Is this then the context switch before the shell gets to run again? That would be surprising. –  ensonic Aug 14 '12 at 9:21
My guess is that your terminal's nice level is outranked by more demanding processes, so it cannot compete for CPU and has to wait a little longer for attention. –  invert Aug 14 '12 at 9:23
How high of a load are we talking here? can you add some CPU averages for us? –  invert Aug 14 '12 at 9:24
Are you sure it's finished? Have you traced it to be certain that it has exited and returned control to the shell? There are about a million things that it could be, ranging from software to hardware. –  bahamat Aug 14 '12 at 9:24

Something slow is running before each prompt, through the PROMPT_COMMAND mechanism. In my case, this.

-