Alpha Video Training
Results 1 to 20 of 20

Thread: Scheduled task slow speed

  1. #1
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Scheduled task slow speed

    I run a number of maintenance tasks overnight. This is the first time I have had a slow speed issue.

    This job should run about 1 hour. If I start it from the database script or from a .bat file that runs the script, the run time is consistently about an hour. However, if the bat file is run as a scheduled task, then mostly it will take 3-8 hours. With no other users in the system I can run the bat file in 1 hour and then fire off the bat file from the scheduled task window and it takes 5 hours.

    I have set the task to run
    F:\Data\scheduled_sumtables.bat
    and
    C:\Windows\System32\cmd.exe /C F:\Data\scheduled_sumtables.bat

    with similar long results.

    Just today I noticed in Windows task manager that the scheduled task has allocated les RAM than when I run directly from the bat file. Of course the RAM allocated is dynamic so maybe I am just seeing it when it is low, but at 10 MB it is significantly below the ~ 70 MB when the bat is run directly.

    The recent thread mentioning powershell gives me the idea to try that, but any other thoughts on what might make a scheduled task run slower?

    Bill.

  2. #2
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,369

    Default Re: Scheduled task slow speed

    What OpSys version Bill?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  3. #3
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,369

    Default Re: Scheduled task slow speed

    If it's Win10, most likely the update process is hogging the resources.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  4. #4
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    The scheduled task is running on Server 2008 R2.

    The slowness is in summarize operations, e.g. summarize.run_silent("my operation", vFilter) As each operation runs I can watch the file update time in Windows explorer. These operations are taking 30-60 minutes when it is more logical for them to be just a few minutes.

    Bill.

  5. #5
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,369

    Default Re: Scheduled task slow speed

    Could then be a corrupt index, I presume you rebuild regularly.
    Or a corrupt record.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  6. #6
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: Scheduled task slow speed

    Bill

    Pretty strange.

    Does task scheduler run as a different user?

    Are some tables open by other processes when the scheduled task runs.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  7. #7
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    Ted,

    Indexes rebuild just before this task. and in one test I ran it manually in an hour, then ran it again through the task - taking 5 hours.

    Hi Al, same user is defined for the task. No other users should be active, and confirmed none were active during these tests. I am going to see some powershell guys this weekend, so I'll have me set that up. Meantime I will get better stats on RAM and cpu usage for tonight's run.

    Bill.

  8. #8
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: Scheduled task slow speed

    If these are Alpha routines, can you run them from a script? I'm thinking that an OnDatabaseClose routine might help - then you could use the task scheduler to just close Alpha...and then Alpha would control the process.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  9. #9
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: Scheduled task slow speed

    Quote Originally Posted by MoGrace View Post
    If these are Alpha routines, can you run them from a script? I'm thinking that an OnDatabaseClose routine might help - then you could use the task scheduler to just close Alpha...and then Alpha would control the process.
    The way I prefer is to create an Alpha generated shortcut that you put in xbasic to run when task scheduler runs.
    navigate - desktop control panel - tools - create shortcut
    You get a <your-named>.startup file that contains the xbasic code that is run.

    The command line and start in of the shortcut gives the startup that task scheduler needs.

    I use all functions that call functions within this routine rather than scripts to get the tightest control possible.

    the last call is to a5.close()
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  10. #10
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    My method is similar to Al's, but I use the startup command's ability to close Alpha. So the bat file looks like this
    Code:
    "C:\Program Files (x86)\a5v11 Runtime\alpha5.exe" "F:\Data\Utilities\sumtables.adb" -INCLUDE="scheduled_sumtables.startup"
    and the startup file looks like this
    Code:
    -TITLE="Windows scheduled task - Sumtables U1"
    -NOSPLASH
    -ExecuteAndExit
    -COMMAND="script_play(\"rpt_sumtables\")"
    The script just calls a function of the same name. Al, you are saying you do -COMMAND="rpt_sumtables()"? I would prefer that, but it sticks in my mind that was not possible in the early days and I have just stuck with the same pattern.

    Bill.

  11. #11
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: Scheduled task slow speed

    Quote Originally Posted by Bill Parker View Post
    The script just calls a function of the same name. Al, you are saying you do -COMMAND="rpt_sumtables()"?
    Bill.
    Yes

    Is the -ExecuteAndExit option a newer one? I don't recall that one. Must be CRS.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  12. #12
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    Now that you ask... I "know" that I found it in the runtimedocumentation.pdf, but I don't see it there in recent versions. Maybe I saw it somewhere else. Don't you just love the serendipity of Alpha's documentation!

    Bill.

  13. #13
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: Scheduled task slow speed

    Hi
    Quote Originally Posted by Bill Parker View Post
    Now that you ask... I "know" that I found it in the runtimedocumentation.pdf, but I don't see it there in recent versions. Maybe I saw it somewhere else. Don't you just love the serendipity of Alpha's documentation!

    Bill.
    No doubt.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  14. #14
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    Found it. Do a full text search in v11 help for "executeandexit".

  15. #15
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,699

    Default Re: Scheduled task slow speed

    I found it in the Wiki Starting Alpha Anywhere With Command Line Options

    Another thought...
    If your F: path is a mapped drive to the server, maybe using the fully qualified '\\servername\datapath\batchfile' format would work better?
    Last edited by MoGrace; 12-14-2016 at 05:42 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  16. #16
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    I am running on the server, so I could have said D:\Alpha\Data\... But it is helpful to map a drive letter on the server the same as user workstations have. That way the context is always identical regardless of where something is run. For example, scheduled task could be run from a workstation or the server.

    When looking at the command line options again, I am going to add NoDebug, and NoDBCheck to see if they make any difference.

    Bill.
    Last edited by Bill Parker; 12-14-2016 at 07:11 PM.

  17. #17
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    Solved. What worked is changing the priority of the scheduled tasks. That can't be done from the GUI, so export the task, modify the XML and re-import the task. Scheduled tasks default to "below normal" priority. I changed this to "normal" priority. Look at this article.

    Bill.

  18. #18
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,628

    Default Re: Scheduled task slow speed

    Quote Originally Posted by Bill Parker View Post
    Solved. What worked is changing the priority of the scheduled tasks. That can't be done from the GUI, so export the task, modify the XML and re-import the task. Scheduled tasks default to "below normal" priority. I changed this to "normal" priority. Look at this article.

    Bill.
    Good tip. Probably best not to run with the highest privileges. Too many OS conflicts.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  19. #19
    VAR
    Real Name
    Bill Parker
    Join Date
    Apr 2000
    Location
    Dallas, TX
    Posts
    1,714

    Default Re: Scheduled task slow speed

    Yes. If you are running with highest priority then your task is higher than the one that would allocate resources to you - catch 22. I tried 6, but ended up at 4. 4-6 is "normal".

    Bill.

  20. #20
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,875

    Default Re: Scheduled task slow speed

    We run several scheduled tasks overnight using windows task scheduler, and in our experience, the speed is extremely fast. We don't run any sort of .bat files, we just run alpha5 with command line options to open up a database that has all the tables needed and an autoexec that runs all the appropriate posts, updates, packs, etc.

    There really is NO Need to add another level of execution by creating a .bat file to run the alpha program.

    We run the task as administrator, giving the proper password when setting up the task.

    We had been running server 8, but we recently upgraded servers and are now using server 12 r2.

    Tom

Similar Threads

  1. scheduled task for db with security
    By Bill Parker in forum Windows Desktop Applications
    Replies: 3
    Last Post: 08-10-2016, 07:14 PM
  2. Scheduled task failing
    By Steve Workings in forum Mobile & Browser Applications
    Replies: 20
    Last Post: 12-24-2015, 05:11 AM
  3. UX data binding slow the speed
    By jennygong in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 10-09-2014, 02:09 PM
  4. How can i slow down a script the speed
    By Digitaled in forum Alpha Five Version 8
    Replies: 6
    Last Post: 04-16-2008, 11:29 AM
  5. Import and append speed is too slow...
    By spain246 in forum Alpha Five Version 6
    Replies: 8
    Last Post: 10-27-2005, 07:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •