หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Use asynchronous processing to run AL code without making users wait for a batch to finish. You can also split independent work into smaller tasks and run them in parallel.
Choose a mechanism based on the work you need to run and its lifetime. The following table also identifies the main Business Central online limits.
| Mechanism | Characteristics | Main Business Central online limits |
|---|---|---|
| Page background task | Read-only database access in a child session tied to the calling page and parent session. Canceled if the page or parent session closes, the current record changes, or the task times out. Can also be canceled explicitly. | Child session concurrency and queue length; page background task timeouts |
| Session.StartSession | Creates a background session on the same Business Central Server instance when called. Codeunit execution can wait in the background-session queue. Not tied to a page or the lifetime of the calling session. Can write to the database, subject to permissions. Subject to background-session queueing and timeout controls. | Background session concurrency, queue length, and waiting timeout |
| Task scheduler | Stores a task for execution when it's ready and its earliest start time has passed. Runs in a background session on an eligible server instance in the cluster. Tasks are persisted in the database and recoverable after server restarts. Monitor execution through task scheduler telemetry and session events. | Scheduled task concurrency |
| Job queue | Supports one-time and recurring schedules. Uses the task scheduler to run in a background session on an eligible server instance. Uses persisted job queue entries and scheduled tasks, with restart recovery. Records execution status and error details in Job Queue Log Entries. | Scheduled task concurrency, shared with other scheduled tasks |
For scheduled tasks, the server instance must have task scheduling enabled and serve the tenant. Restart recovery can rerun work; it doesn't resume execution at the interrupted instruction.
Operational limits for Business Central online
Each asynchronous processing mechanism has its own concurrency and timeout controls. Use the following table to identify the applicable limits. Learn more about current values in Operational limits for Business Central online.
| Mechanism | Limits to check |
|---|---|
| Page background task | Asynchronous task limits: child sessions max concurrency and max queue length, per parent session; page background task default and maximum timeouts. |
Session.StartSession |
Asynchronous task limits: background sessions max concurrency, max queue length, and default waiting timeout. |
| Task scheduler | Scheduled task limits per user: concurrent execution of scheduled tasks. |
| Job queue | Scheduled task limits per user, because scheduled job queue processing uses the task scheduler. |
Scheduled tasks run in background sessions, but they don't use the same concurrency limit as sessions started with Session.StartSession. Scheduled-task concurrency limits control how many tasks can run at the same time, not how many tasks can be stored for later execution.
Configure limits for Business Central on-premises
For on-premises environments, configure the corresponding server instance settings.
| Mechanism | Settings to check |
|---|---|
| Page background task | ChildSessionsMaxConcurrency, ChildSessionsMaxQueueLength, PageBackgroundTaskDefaultTimeout, and PageBackgroundTaskMaxTimeout. |
Session.StartSession |
BackgroundSessionsMaxConcurrent, BackgroundSessionsMaxQueued, and BackgroundSessionsDefaultWaitTimeout. BackgroundSessionsDefaultTimeout sets the execution timeout when the method call doesn't specify one. |
| Task scheduler | TaskSchedulerMaximumConcurrentRunningTasks limits concurrent execution per server instance. DefaultTaskSchedulerSessionTimeout and MaxTaskSchedulerSessionTimeout control execution timeouts. Task scheduling must be enabled with EnableTaskScheduler. |
| Job queue | The task-scheduler concurrency and maximum-timeout settings apply. The job queue supplies its job timeout when it creates the scheduled task. |
Learn more about these settings in Business Central Server instance settings. Learn more about changing them in Configure Business Central Server.
Related information
Job queue
Page background tasks
Task scheduler
Operational limits for Business Central online
Performance articles for developers