This topic contains 5 replies, has 0 voices, and was last updated by BrettKnights 6 years, 10 months ago.

  • Author
    Posts
  • #18178

    Laaki

    Hello!

    I was wondering, is there any way to “multi-thread” scheduled scripts?

    Now, the problem is this. I have a huge amount of records in need to transform.

    I have created the list and started to do the transforms in a loop (with a single scheduled script that spawns a new scheduled script when usage is used). And this will take forever…

    I have tried several ways to do threading. I have created two versions of the scheduled script with different input parameters and different deployments.

    Example:

    Code:
    var taskOne = task.create({ taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: “customscript_script_a”, deploymentId: null, params: { custscript_params_a: masterArrayFirstHalf } });
    var taskOneId = taskOne.submit();
    var taskTwo = task.create({ taskType: task.TaskType.SCHEDULED_SCRIPT, scriptId: “customscript_script_b”, deploymentId: null, params: { custscript_params_b: masterArraySecondHalf } });
    var taskTwoId = taskTwo.submit();

    NetSuite still puts them in a row, so that they do not run at the same time.

    I tried Map reduce function and it took the same amount of time as one scheduled script.

    So, letยดs say a single scheduled script does 100 transformations in a minute. Two scheduled scripts running at the same time would do 200 transformations in a minute.

    Is there a way to achieve this?
    This is a cached copy. Click here to see the original post.

  • #18179

    leacelosacolumna

    Hi Laaki, this is only possible if the account you are testing with have multiple queues. Multiple queues are obtained by purchasing a SuiteCloud Plus license.

  • #18180

    Laaki

    Thank you suitecloudfanatic for your response.

  • #18181

    pcutler

    Also, with 2018.1, every account will be upgraded to having 2 “processors.” So check your upgrade date in the new release portal, this should be available in your account soon. Once its available, you can remove the queue reference from a script deployment record and the script deployment record will run in the first available queue. Just make sure to test in sandbox before making this change in production!

  • #18182

    rnedelkow

    On a related note, this video highlights 2018.1 platform changes including the 2 SuiteCloud processors.

  • #18183

    BrettKnights

    Will SuiteCloud Plus still have 5 and control?

    Also one way to get quite parallal is to script CSV imports.

    If your mods are amenable to CSVs then your scheduled script might be able to generate csv files to submit to the CSV processor. I’ve done that where I was scripting a nightly update of around 36k records and it worked pretty well (i.e. it didn’t tie up all our script queues and the updates finished in the “closed” period of the day)

You must be logged in to reply to this topic.