Hi everyone,
I’ve made an automation that navigates through different views of tables (SQL pannel) in db2i in an AS/400 using UiPath terminal emulator. The automation works pretty well, it navigates all screen views, get the data and make some transformations to generate an Excel file. But the problem is, since the beginning, Terminal Activities get slower and slower. The tables aren’t that big (~1000-5000 rows) and the total amount of screens to be saved per table could be around the same number.
I’ve checked and double-checked with log messages right before and after Terminal activites and, if the first minute it takes 200-300 milliseconds/activity, after 1 hour it takes more than 10 seconds/activity. At first glance I thought I had a processor/memory problem but now I’m thinking the problem is with the Terminal Activities library itself.
1.Try downgrading this to 2.6.0 or 2.5.0 and then see if it makes a difference.
2.Are you doing a graceful logout or closure of terminal sessions, make sure you sessions are not hanging on the server side, you can check this with the application team.
3.Verify while executing terminal activities if RAM shoots up temporarily from task manager you can monitor system performance.
I’ll try to test the scenario on my environment but in order to make it similar to what you have I need some info:
Are you using the Output/Existing Connection options?
Is it a “Windows” or “Windows-Legacy” project?
Can you show the structure of the loop that goes through the screens. I’m interested in the terminal activities you have in the loop. Probably something like:
while
Get Screen
Send Control key (PF8)
Also, I’m curious if you tried to take the ODBC route to access the DB2 database.
Cheers
Yes, data extraction workflow is invoked in Main, in which I start the connection (could be this the origin of the problem?)
It’s Windows project
Regarding the workflow, is more or less like this in pseudo code:
while not finalLines
//Get all screens in data lenght
For each screen in dataLength
//Extract screen text
strScreenText Get_Screen_Area() //UiPath activity that gets slower over time
//Check if last line of tables
If Get_Field() contains "****final line****" //UiPath activity that geets slower over time
Then finalLines = True
//Check next move
If End Of DataLength
//Press NextPage to move down to next rows
Then Send_Control_Key(NextPage) //UiPath activity that gets slower over time
//Press F20 to move forward
Else Send_Control_Key(F20) //UiPath activity that gets slower over time
My UiPath code is not exactly like this but the important thing is for each iteration, I have those three activities: Get Screen Area, Get Field, and Send Control Key.
As I told you, it’s strange how all of them become slower as time passes. Maybe I have to reset something in each iteration?
We haven’t tried to use ODBC yet (but that’s our next move).
Yes, the automation is prepared for logging out always from the server.
About the System performance, we didn’t noticed any change during execution, everything seems to be normal and without peaks or using all resources (Processor 40%, RAM 60%)
There’s one thing I forgot to mention: the terminal connection is stored in a global variable, so I could call it from anywhere in the project without passing it as an argument.
Hi @jose.arenas, I was able to replicate the issue. In my case, the loop iteration starts with about 0.4 seconds and goes to 3-4 seconds in about one hour.
I’ll try to find the cause and I’ll update here on the findings.
Cheers!
Hi @jose.arenas, I found that the root cause for the increased execution time is the telemetry, a feature that was added in 2.6.1.
I see no execution time increase when running with 2.6.0. So, for now please use this as a workaround.
As for an explanation for the problem, I have the following: the telemetry for the Terminal Session activity collects some information like “activity name” and “execution duration” for terminal activities in the body of the session and sends all the collected data when the Terminal Session ends its execution. Since you are executing thousands of such activities it takes an ever increasing time to process the data and an ever increasing memory to store the data.
Thanks a lot @bogdan.gaspar ! That solved the problem. Before, the process to extract one specific table was taking 3 hours only for half of the table. With the downgrade from 2.6.1 to 2.6.0, the entire table has been extracted in 30 minutes.