Routine and background tasks. Background jobs: features, capabilities, settings 1s 8 3 disable background jobs

After switching from 1C: Accounting 2.0 to edition 3.0, the speed of the new version becomes slower. We will look at this problem in this article and provide step-by-step instructions for actions in the 1C: Accounting 3.0 program, which will help make its work faster.

As a rule, the reason for the slow operation of the program lies in the fact that routine and background jobs are running in the system. In the server version of the version 3.0 configuration, they allow you to automate many operations to maintain the program during non-working hours. But in the file mode of operation, background jobs are launched while the user is working, and therefore the system slows down.

To speed up work in 1C: Accounting 3.0 file mode, it is recommended to disable background jobs. To do this, we need to refer to the section Administration. In this section in the navigation panel we find Support and service.

Open the section Regulatory operations and then click on the link Routine and background tasks.

A list will appear in front of you, in which active (enabled) tasks are ticked.

To disable a task, you need to open it and uncheck the option "Enabled", then press the button Save and close.

When working in the file version of the program, we recommend disabling all routine tasks present in the list. Another possible reason for the low speed of the system is the enabled mechanism Full text search. Since in the 1C: Accounting 3.0 program this mechanism is optional, it can be disable. To do this, you need to go to the section Regulatory operations uncheck Full-text data search.

Users often complain that “1C 8.3 is slow”: document forms open slowly, documents take a long time to process, the program starts, reports take a long time to generate, and so on.

Moreover, such “glitches” can occur in different programs:

The reasons may be different. This is not restored documents, a weak computer or server, the 1C server is incorrectly configured.

In this article I want to look at one of the simplest and most common reasons for a slow program - . This instruction will be relevant for users of file databases for 1-2 users, where there is no competition for resources.

If you are interested in more serious optimization of client-server options for system operation, visit the section of the site.

Where are the scheduled tasks in 1C 8.3?

Before I had time to load the program, many background tasks were completed in 1C. You can view them by going to the “Administration” menu, then “Support and Maintenance”:

Get 267 video lessons on 1C for free:

This is what the window with completed tasks looks like:

And here is a complete list of all scheduled tasks that are launched:

Among these tasks you can see such as ““, loading various classifiers, checking the relevance of the program version, and so on. For example, I have no use for almost all of these tasks. I don’t keep currency records, I control the versions myself, and load classifiers as needed.

Accordingly, it is in my (and in most cases in your) interests to disable unnecessary tasks.

Disabling routine and background tasks in 1C 8.3

Platforms: 1C:Enterprise 8.3, 1C:Enterprise 8.2, 1C:Enterprise 8.1
Configurations: All configurations

2012-11-13
53989

In document management, there are tasks that require periodic execution - for example, on the twentieth, or daily. As a rule, companies create certain rules specifically for this purpose, which indicate when and how the necessary task should be performed, and who should control the process. Such tasks are performed according to regulations and are called regulated.

Quite often, monitoring regulations are observed in IT. This method is very familiar to administrators, since for this purpose there are special programs used to periodically check the functionality of the network infrastructure and servers. They notify the administrator about detected problems via SMS or email.

A similar system operates for webmasters, and the site’s availability is checked within 24 hours. Using the "Routine tasks" mechanism in 1C, monitoring tasks are carried out, as well as periodic tasks that are performed according to a schedule in automatic mode in 1C. Let's take a closer look at this topic.

Scheduled tasks 1C

The 1C object, called “Routine tasks,” makes it possible to process information not after a problem occurs, but according to a schedule. In the configurator, a routine task is a way to set settings and set a schedule. In addition, it is possible to subsequently change the schedule in 1C Enterprise mode.

When using a file database, jobs are not automatically executed. In order to start the process, you need to start a 1C session in 1C Enterprise mode and start executing a routine task in it.

All standard configurations have a user setting that allows you to specify that when 1C is running, routine tasks will be performed automatically.

Using the client-server version of 1C makes it possible to automatically perform tasks on the server. At the scheduled time, a background job is launched, which performs the necessary actions. For parallel computing on the server, a background job can be created from the program text using the 1C language, without using a scheduled 1C job. The action of a scheduled task can be temporarily disabled using the 1C server management console.

Adding a scheduled task

Routine tasks are located in - Configurator - General - Routine tasks. Add a new "task" and provide a name. Next, you need to go to the “Tasks” properties. And select Method Name. Here, you need to specify a handler function, just as it happens in an event subscription. This function will be located in the general module and marked with a “bird” Server in the properties. This means that the required module must be added in advance.

The name of the task in the Properties of a scheduled task allows you to define its name, which will then appear in the task management tools. The Routine Task Properties function is a key that allows you to group several different routine tasks. In this case, only one task with the same key value can be launched at a time. Here, the value can be arbitrary, but it must be filled in, since an empty value is not taken into account by the system.

In Accounting edition 2.0, which is a standard configuration, routine tasks such as: “Recalculation of totals” and “Updating the configuration” are predefined, but such as, for example, “Deferred movements” and “Data exchange” are not predefined.

Retry on abnormal termination - restarts the current job. Designed to perform a launch that was not successful the first time. Here, it is indicated how many times you can restart and after what time has passed after an abnormal termination.

Monitoring and management tools for routine tasks 1C

The standard processing “Task Console”, which can be found on the ITS disks, is responsible for managing a routine task. This processing is a universal external standard processing 1C. As a rule, it is not included in the configuration, but is purchased separately.

With its help you can perform the following actions:

Turn on and off a scheduled task;

Assign and change schedules;

Designate the user name with which the routine task will be performed;

See completed tasks (when and with what result), as well as task errors;

Routine task and copies of databases

When using server 1C, the following moment may arise:

To program, you need to make a copy of the working database;

The need to work in copies of the database (testing);

For some reason, the scheduled task was not included in the test database.

If one of these situations arose during the execution of tasks by a routine task that are associated only with their database, then this does not have negative consequences. But, often, a routine task can save files or other data, send emails, and conduct exchanges. In this case, confusion may arise between the results of the “job” and the copies. To prevent this from happening, you need to disable “tasks” in the server management console.

Completed and not completed regulatory tasks

When creating routine tasks, it is important to check whether the task can be executed as a routine task. It's important to know that the server module doesn't do many things that are possible on the client. Further, a task that deals with something that is outside the database - an important role in this is played by the rights of the Windows user under which the task is executed.

The last factor is especially important, since if the module is not executed on the server, then the task cannot be completed in principle. To check, you need to run one task and evaluate the result.

The problem is not new and is discussed from time to time on various 1C forums. The simplest and most popular solution is to reboot the 1C server. Unfortunately, this option is not always acceptable or highly undesirable. In such a case, there are more delicate solutions.

Here one of these methods in the form of brief step-by-step instructions:

1. Using the 1C server administration console, we are looking for problematic fa new job in the connection list (for example, by the start time of its operation, compared with the start time of a regulated job in the job console). We definethe worker process in which the hung connection is located.

2. Open the properties of this process and mark it as unused (if only one process is used, then you must first create a new worker process so that all active connections reconnect to it). We remember the PID number of this process.


3. We wait until all current connections move from the disabled process to one of the used ones. Ultimately, only problematic connections should remain in our process, which we want to remove.

4. On a computer with a 1C server, using the task manager, look for the corresponding rphost.exe process using the PID of the disabled worker process and delete it.

5 . Just in case, you can delete the 1C workflow that we disabled using the admin. console and, if necessary, create a new one.

6. Ready. You can log into the job console and check the functionality of the scheduled job.

When working in 1C, there are many routine operations that must be launched or formed according to a schedule to perform one or another action, for example: posting documents or loading data into 1C from a website.

I recently posted an article: It's time to automate this:

Routine and background tasks

The job engine is designed to perform any application or functionality on a schedule or asynchronously.

The task mechanism solves the following problems:

  • Ability to define regulatory procedures at the system configuration stage;
  • Execution of specified actions according to schedule;
  • Making a call to a given procedure or function asynchronously, i.e. without waiting for its completion;
  • Tracking the progress of a specific task and obtaining its completion status (a value indicating whether it was successful or not);
  • Obtaining a list of current tasks;
  • Ability to wait for one or more tasks to complete;
  • Job management (possibility of cancellation, blocking of execution, etc.).

The job mechanism consists of the following components:

  • Metadata of routine tasks;
  • Regular tasks;
  • Background jobs;
  • Task Scheduler.

Background jobs & are designed to perform application tasks asynchronously. Background tasks are implemented using the built-in language.

Scheduled tasks & are designed to perform application tasks on a schedule. Routine tasks are stored in the information base and are created based on metadata defined in the configuration. Metadata of a regulatory task contains information such as name, method, use, etc.

A routine task has a schedule that determines at what times the method associated with the routine task must be executed. The schedule, as a rule, is specified in the information base, but can also be specified at the configuration stage (for example, for predefined routine tasks).

The task scheduler is used to schedule the execution of routine tasks. For each scheduled job, the scheduler periodically checks whether the current date and time matches the schedule of the scheduled job. If it matches, the scheduler assigns that task to execution. To do this, for this scheduled task, the scheduler creates a background task, which performs the actual processing.

I think that’s enough with the description - let’s get down to implementation:

Creating a routine task

Method name– path to the procedure that will be executed in a background job according to a given schedule. The procedure must be in a common module. It is recommended not to use standard common modules, but to create your own. Don't forget that background jobs run on the server!

Usage– sign of using a routine task.

Predetermined– indicates whether the routine task is predetermined.

If you want the routine task to work immediately after being placed in the database, specify the attribute Predetermined. Otherwise, you will need to use the “Job Console” processing or trigger the task to run programmatically.

Number of retries when a task terminates abnormally– how many times the background job was restarted if it was executed with an error.

Retry interval when job terminates abnormally– how often the background job will be restarted if it was completed with an error.

Setting up a schedule

Schedule completing the task:

Every hour, just one dayRepeatDays Period = 0, RepeatDays Period = 3600
Every day once a dayRepeatDays Period = 1, RepeatDays Period = 0
One day, one timePeriodRepeatDays = 0
Every other day once a dayPeriodRepeatDays = 2
Every hour from 01.00 to 07.00 every dayPeriodRepeatDays = 1RepeatPeriodDuringDay = 3600StartTime = 01.00

End Time = 07.00

Every Saturday and Sunday at 09.00RepeatDays Period = 1WeekDays = 6, 7StartTime = 09.00
Every day for one week, skip a weekPeriodRepeatDays = 1PeriodWeeks = 2
At 01.00 onceStart Time = 01.00
Last day of every month at 9:00.PeriodRepeatDays = 1DayInMonth = -1StartTime = 09.00
Fifth day of every month at 9:00PeriodRepeatDays = 1DayInMonth = 5StartTime = 09.00
Second Wednesday of every month at 9:00PeriodRepeatDays = 1DayWeekMonth = 2DaysWeek = 3

Start Time = 09.00

Features of executing background jobs in file and client-server variants

The mechanisms for executing background jobs in the file and client-server versions are different.

In file version you need to create a dedicated client process that will perform background jobs. To do this, the client process must periodically call the global context function ExecuteJobProcessing. Only one client process per infobase should process background jobs (and, accordingly, call this function). If a client process has not been created to process background jobs, then when programmatically accessing the job engine, the error “Job Manager is not active” will be displayed. It is not recommended to use a client process that processes background jobs for other functions.

Once the client process processing background jobs is started, other client processes are able to programmatically access the background job engine, i.e. can run and manage background jobs.

In client-server version To execute background jobs, a task scheduler is used, which is physically located in the cluster manager. For all queued background jobs, the scheduler gets the least loaded worker process and uses it to run the corresponding background job. The worker process executes the job and notifies the scheduler of the execution results.

In the client-server version, it is possible to block the execution of routine tasks. The execution of routine tasks is blocked in the following cases:

  • An explicit blocking of routine tasks has been installed on the information base. The lock can be set via the cluster console;
  • There is a connection block on the infobase. The lock can be set via the cluster console;
  • The SetExclusiveMode() method with the True parameter was called from the built-in language;
  • In some other cases (for example, when updating the database configuration).

Processing the launch and viewing of scheduled tasks you can download here.