This topic describes how to use SchedulerX.
Practice guidelines
Perform a canary release on SchedulerX jobs
SchedulerX jobs support label-based routing policies. You can configure labels in an SDK to automatically schedule jobs to workers with a specific label to complete the canary release of jobs. For more information, see How do I perform canary release of SchedulerX jobs?.
Integrate Simple Log Service with SchedulerX
Simple Log Service can help you record and analyze key information during system operations. This helps you troubleshoot system faults and identify potential issues. To integrate Simple Log Service with SchedulerX 2.0, you only need to add the Log4j or Logback configuration. Code modifications are not required. After the configuration is added, you can view the logs of the jobs, including distributed jobs, that are triggered in the SchedulerX 2.0 console. For more information, see Integrate Simple Log Service with SchedulerX 2.0.
Configure an application to support more than 100,000 SchedulerX jobs
By default, an application that is created in SchedulerX supports up to 1,000 jobs. However, your application may require more than 1,000 jobs in specific scenarios. In most scenarios, each job is scheduled at different points in time. MapReduce tasks are not suitable for these scenarios. To enable a single application to support more than 100,000 jobs, you can contact SchedulerX technical support engineers to enable automatic application scale-out. You can also use a client of version 1.2.1 or later to connect to SchedulerX and enable the shared container pool feature. For more information, see Configure an application to support more than 100 thousand periodic jobs.
Perform application-level throttling based on job priorities in a queue
In traffic burst scenarios, a large number of jobs need to be scheduled. This may cause a high workload on the system. For example, a large number of daily jobs are configured to be scheduled at the same time. If the system does not take any effective measures to cope with this situation, backend services may fail to handle the concurrent workloads. This may cause a system breakdown. In SchedulerX, you can perform application-level throttling by enabling throttling for the application, setting the queue size, and configuring preemptible priority queues. For more information, see Perform application-level throttling based on job priorities in a queue.
Create second-delay jobs
Second-delay jobs are suitable for workloads that are sensitive to timeliness, such as near-real-time workloads that must continuously perform round robin. You can use the memory grid model and second-delay jobs to continuously process a large amount of data. Second-delay jobs that you can create in SchedulerX are periodic jobs. You can use second-delay jobs if you want to run simple Java jobs or distributed Java jobs, or execute Java scripts. In addition, you can use different methods to run second-delay jobs. For more information, see Create second-delay jobs.
Process time series data
For example, a job is triggered at 00:30 every day. If you want to use the job to process data that was updated at 23:30 on the previous day, you must set the time offset of the job to 1 hour. You can use time series to process data at the time that is different from the job scheduling time. For more information, see Process time series data.
Update job outputs
If your workloads are updated, you can run the corresponding job again to reprocess the data within a specific time period. For example, if you added a new field to the database or the data that was generated at a point in time in the previous month contains errors, you can update the output of the corresponding job. For more information, see Update job outputs.
Integrate Managed Service for OpenTelemetry with SchedulerX
For distributed microservices, the end-to-end tracing analysis feature enables you to quickly analyze the execution of requests in each service in a visualized manner. For scheduled jobs, the period of the service execution workflow may be longer than that of common real-time services. Integration with Managed Service for OpenTelemetry can help you query the execution durations of jobs and analyze execution exceptions. For more information, see Integrate tracing analysis.
Specify a tag
Tags are suitable for canary release and stress testing scenarios. For machines in the same application group, some of them may be used for canary release or stress testing, and the job implementation class of these machines is different from that of other machines. You can specify tags in SDKs to resolve the inconsistency issue. For more information, see Specify a tag.
Gracefully shut down jobs in an application
Jobs are continuously executed in application processes at fixed intervals. When an application is restarted during release, the application process must be temporarily shut down. If you close the application, the ongoing scheduled jobs are interrupted. This may cause incomplete data or other issues. To prevent this situation, SchedulerX allows you to implement a graceful shutdown for scheduled jobs. You must wait until the running jobs are complete before you safely close the application. For more information, see Gracefully shut down jobs and tasks executed in an application.