How to check long running scripts what are the recommendation and the best practices.

Meenal Gharat
Giga Guru

Hello Experts,

I am looking for the recommendations and best practices to replace long running scripts.

Kindly advise

Thanks and Regards,

Meenal

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

There are many ways to go by it

1) you can always check the 'All active transactions' from left nav.

2) You can take a look at slow queries and scripts and debug there.

find_real_file.png

 

One very important thing to note is: If there is a script that runs once a month for 5 mins Vs a script that runs 50 times a day for 30 sec, which one do you think needs more attention? 🙂

 

-Anurag

 

 

-Anurag

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Meenal Gharat 

You need to check that in the transaction logs.

Which script is taking long time to run; you can also kill the transaction if something is running in long i.e. possibly some script which is not proper

https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/platform-performa...

https://community.servicenow.com/community?id=community_question&sys_id=1982c321dbd8dbc01dcaf3231f96...

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Anurag Tripathi
Mega Patron
Mega Patron

There are many ways to go by it

1) you can always check the 'All active transactions' from left nav.

2) You can take a look at slow queries and scripts and debug there.

find_real_file.png

 

One very important thing to note is: If there is a script that runs once a month for 5 mins Vs a script that runs 50 times a day for 30 sec, which one do you think needs more attention? 🙂

 

-Anurag

 

 

-Anurag

Good afternoon, my question is, what do you consider health scan to be heavy? since there is a script with the same execution average.

On the other hand, should I look at the average execution time or the total execution time?

Thank you very much for your contribution.

Anil Shewale
Mega Guru

Hi  Meenal Gharat

practices to replace long running scripts.

An additional trick you can use if your browser session is blocked, is to navigate to https://myinstance.service-now.com/cancel_my_transaction.do

This behaves in the same way as navigating to the 'Active Transactions' module and will, in most cases, terminate the running transaction which is blocking your session.

 

This is quite handy, as you are not reliant upon other people to intervene on your behalf. You also do not have to play node-roulette with the load balancer to find your way to the same node (if you were to use a different browser and the Active Transactions module).

How to Cancel a Long Running Transaction:

https://hi.service-now.com/kb_view.do?sysparm_article=KB0635968

 

If it help mark helpful or correct 

Thanks and regards

Anil