Jump to content
Sign in to follow this  
mdoupe

Autoit script runs VERY slow in console session VS. RDP.

Recommended Posts

mdoupe

Hi guys, just started using autoit, and it's quite enjoyable so far.

I made my first script up under an RDP session, and it worked great, would execute and do exactly what it was supposed to in seconds.

I logged in at the console to run the same script, and when it runs, the script executes very very slow. about 1 second between each keypress/click. I right clicked on the autoit icon in the tray to stop execution and it took about 5+ seconds to show me the menu. I checked task manager and I had 2% CPU usage, the autoit.exe process was at 0% usage, but it was still dog slow.

any ideas would be appreciated!

Share this post


Link to post
Share on other sites
PsaltyDS

So... what's the script doing? Post a short example that runs with the symptoms you described.

:idea:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
mdoupe

Run("program.exe", "", @SW_MAXIMIZE)
WinWaitActive("Program")
Send("{ESC}")
Send("!fs")
WinWait("Connection Wizard")
Sleep(500)
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}Database Name{TAB}{TAB}{TAB}{TAB}{ENTER}")
Send("!fl")
WinWait("Program")
Send("some text")
Sleep(5000)
MouseClick("left", 10, 550, 1, 0)
Sleep(1000)
MouseClick("left", 88, 583, 1, 0)

etc...

very basic code. and like I said, it is extremely snappy in my RDP session. it works under the console, just VERY slowly. the whole script takes about 10 minutes.

also, in the "Send" directives, each character takes about 1 second to be typed. in each "MouseClick", each click takes about a second, so double clicks are impossible.

Send("some text") takes 9 seconds to finish.

the program the script is interacting with is very snappy if I run it by itself from the console.

Share this post


Link to post
Share on other sites
PsaltyDS

When you run from the console, does that mean via a VM client, or by the actual local keyboard/mouse?

:idea:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
mdoupe

When you run from the console, does that mean via a VM client, or by the actual local keyboard/mouse?

:idea:

via console shadowing over RDP.

Share this post


Link to post
Share on other sites
mdoupe

I plugged a mouse and keyboard into the machine, logged out and back in, and am getting the same results.

Share this post


Link to post
Share on other sites
mdoupe

I also logged in through rdp and console as another user, and the same behavior is present.

Share this post


Link to post
Share on other sites
mdoupe

What is the processor time being used when this script is being ran?

less than a second of CPU time after 5 minutes of script execution.

Share this post


Link to post
Share on other sites
evilertoaster

Are you using any VMs by chance?

Also can you describe (as detailed as possible) the exact steps you take to reproduce this? I've ran the script in a RDP session (I think with console shadow enabled, but I'v never used that feature), but cannot duplicate...

Share this post


Link to post
Share on other sites
mdoupe

this is a physical machine with no VM's involved. The os is Win2k3.

the exact sequence of events is:

1. Under an RDP session under my username, I created a script (a very simple one, some of which I pasted in an earlier post)

2. once I finished the script, I logged into the console session (shadowed through RDP) as another username I use to run scheduled tasks. This is when the slowness first occurred.

3. I plugged in a mouse and keyboard to the machine, logged out, logged back in as the schedule user, the script ran slow at this point.

4. I logged in as the schedule user through RDP. The script ran properly.

5. I logged in as myself at the keyboard and monitor. The script ran slow.

When the script runs slow, the Autoit process isn't taking up any CPU power, and the CPU is mostly idle. yet every keypress, mouse click, etc. takes about a second.

Share this post


Link to post
Share on other sites
evilertoaster

Here's what I tired, let me know if I'm not following you right:

1. Log on to local PC normally.

2. RDP into remote computer (as yourself). The remote computer already has a 2nd user logged on locally (The "service account" used to run scheduled tasks).

3. In your RDP session:

a. Create and compile a script using this source:

Run("notepad.exe", "", @SW_MAXIMIZE) 
Sleep(500) 
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}Database Name{TAB}{TAB}{TAB}{TAB}{ENTER}") 
Send("some text")

b. Move the complied script to the root of C: (or whatever your install is on).

c. Go to the command prompt and type "shadow console". The "service account" log on is prompted to allow the shadow, which someone does (or, I'm assuming you have it set to auto allow?)

d. Once the shadow is connected, browse to the root of C: and run the script. The send keys happen as usual.

See if you can reproduce that or let me know if you're doing something different.

Share this post


Link to post
Share on other sites
mdoupe

Here's what I tired, let me know if I'm not following you right:

1. Log on to local PC normally.

2. RDP into remote computer (as yourself). The remote computer already has a 2nd user logged on locally (The "service account" used to run scheduled tasks).

3. In your RDP session:

a. Create and compile a script using this source:

Run("notepad.exe", "", @SW_MAXIMIZE) 
Sleep(500) 
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}Database Name{TAB}{TAB}{TAB}{TAB}{ENTER}") 
Send("some text")

b. Move the complied script to the root of C: (or whatever your install is on).

c. Go to the command prompt and type "shadow console". The "service account" log on is prompted to allow the shadow, which someone does (or, I'm assuming you have it set to auto allow?)

d. Once the shadow is connected, browse to the root of C: and run the script. The send keys happen as usual.

See if you can reproduce that or let me know if you're doing something different.

in my RDP session, it takes about a second.

on the console it takes over 30 seconds.

Share this post


Link to post
Share on other sites
evilertoaster

Hum, I run it on the physical log-on and the shadow (Via RDP) just fine...

I'm using Server 2008 64 bit though. Does the behavior happen only with AutoIt scripts or does it affect any other executables?

Edit: Also using AutoIt 3.3.6.1 if that matters.

Edited by evilertoaster

Share this post


Link to post
Share on other sites
mdoupe

Hum, I run it on the physical log-on and the shadow (Via RDP) just fine...

I'm using Server 2008 64 bit though. Does the behavior happen only with AutoIt scripts or does it affect any other executables?

Edit: Also using AutoIt 3.3.6.1 if that matters.

I'm using the latest version as of thursday. no other apps or services are slow on this machine.

Share this post


Link to post
Share on other sites
bogQ

in my RDP session, it takes about a second.

on the console it takes over 30 seconds.

So lets try this :idea:

Do you run it on 640*480 with 256 colors? did you try to run it on that settings to see is it faster?

Or

You hit full screen with True Color (24 bit)? how fast is your connection? :)


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites
mdoupe

So lets try this :idea:

Do you run it on 640*480 with 256 colors? did you try to run it on that settings to see is it faster?

Or

You hit full screen with True Color (24 bit)? how fast is your connection? :)

no, RDP is fine. it's when I'm sitting in front of the machine's keyboard that's the issue.

for kicks, I set it to 1024x768, 16 bit colour (there is no 256 colour option) and it made 0 difference.

typing a couple lines of text in notepad isn't really graphically intensive anyway.

Share this post


Link to post
Share on other sites
bogQ

It is when you use large resolution on slow connection that is why i sugested to try to set it to Less

Its strange that you dont have 256 option

Posted Image


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites
mdoupe

It is when you use large resolution on slow connection that is why i sugested to try to set it to Less

Its strange that you dont have 256 option

Posted Image

no, there is absolutely no RDP involved in the issue. using RDP actually FIXES the problem. When I am RDP'ed into the machine, it WORKS. unfortunately, I can't stay RDP'ed into the machine 24/7 in order for the script to run, it has to run at the console (like, the local console that goes straight out through the VGA port and does not touch the network).

The issue is that when I run the script while standing physically in front of the machine, it DOES NOT work.

Edited by mdoupe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.