Scheduled jobs use all CPUs

Comments

6 comments

  • Vladimir Gurov
    Dear Alexey,

    Please provide us with further details on the server:

    - 1C:Enterprise server version and bitness
    - OS name, version, and bitness
    - DBMS name, version, and bitness
    - (if you use it) web server name, version, and bitness

    Best regards,
    Vladimir Gurov
    0
    Comment actions Permalink
  • Alexey Gerasimov
    Vladimir Gurov,
    I have the problem described here. https://infostart.ru/public/996126/
    As it seems like a "normal behavior", I don{t think version and environment is important. So my question is still how to check some new data without loading context of the Infobase every minute for every Infobase.
    0
    Comment actions Permalink
  • Vladimir Gurov
    Dear Alexey,

    To view the list of existing calls to your 1C:Enterprise server (including scheduled jobs), use the list of connections to your server cluster.

    Indeed, if there are a lot of scheduled job connections and no user connections, it may result in excessive server workload.

    If your task is to check certain new data without loading the context of the infobase every minute for every infobase, the reasonable approach to perform the task is as follows:

    Create a long-lasting job whose duration is, say, 10 hours and make it perform the required checks. You can set this job to run every 1 minute. When there is a running instance of the job, the system does not run a new instance. Though, once the job instance is over, the system starts a new instance of the job in 1 minute.

    This minimizes the resource consumption on loading and releasing the context of the infobase.

    Best regards,
    Vladimir Gurov
    0
    Comment actions Permalink
  • Alexey Gerasimov
    Quote
    Vladimir Gurov wrote:
    Create a long-lasting job whose duration is, say, 10 hours and make it perform the required checks. You can set this job to run every 1 minute. When there is a running instance of the job, the system does not run a new instance. Though, once the job instance is over, the system starts a new instance of the job in 1 minute.

    Help me understand here a little more. If I ran a job for 10 hours, how do I put it to sleep to wake up every minute?
    0
    Comment actions Permalink
  • Vladimir Gurov
    Dear Alexey,

    In the job's schedule, enable Every day and Every minute.

    In the job's code, implement the planned checks in a cycle with the 1-second interval (for instance).

    To avoid excessive processor workload, we recommend you to implement the 1-second pause via a call to an external component that uses the operating system's sleep method.

    Indeed, this solution may seem awkward.

    We can offer a better solution only after a thorough analysis of the requirements of your business case where you decided to inquire something with the intention of getting an immediate response to discovered changes.

    For instance, if the inquiry is needed to provide online information to the user, you can do this in the context of a client's call to the server, instead of a scheduled job running constantly.

    Best regards,
    Vladimir Gurov
    0
    Comment actions Permalink
  • Alexey Gerasimov
    The code of the scheduled job checks from tax administration authorization of electronically issued invoices. Sometimes it take them a little to authorize, so instead of waiting the authorization, we run scheduled job every minute to get authorization of not authorized ones.
    The code is basically query to information register for not authorized records and call to the web server of tax administration for the actual status.
    0
    Comment actions Permalink

Please sign in to leave a comment.