Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Starting a new job with "job" command take more time than expected

Question
Norman W. Freeman · Oct 8, 2021

Starting a new job with "job" command take more time than expected

I use the following code to start a start a job :

Class MyClass Extends (...)
{
    ClassMethod Foo()
    {
       job $CLASSMETHOD("MyClass","MyMethod") //take forever depending hardware
    }

    ClassMethod MyMethod()
    {
       //do database related stuff
    }
}

On local environment, calling Foo() is instantaneous (a few ms). On production/test servers (which have much better hardware than local) calling this function is slow and take between 200 ms to 800 ms. Obviously starting a new job with "job" command take lot of time on those environments.

I don't know the reason of this. Is this a well know issue ?

#Performance #Caché

Source URL:https://community.intersystems.com/post/starting-new-job-job-command-take-more-time-expected