Gateway performance

Good day!

I am trying to understand the different performance we are having betweeen installations, but I cannot find any document that explains the performance dashboards deeply.

In one of my installations I am having this one:

Can anyone tell me when a thread is set in waiting, the difference between waiting and timed waiting, if there is some way to set scripts priority... I would like to read about all of this because in other installation, the performance dashboards are displaying the following:

Thanks a lot in advance!!