Menu
Is free
check in
home  /  BY / Regulatory and background tasks (1CV8). Regulatory and background tasks Create a regulatory task

Regulatory and background tasks (1CV8). Regulatory and background tasks Create a regulatory task

Task Mechanism

The task mechanism is designed to perform any applied or functionality on a schedule or asynchronously.

The task mechanism solves the following tasks:

  • The ability to define regulatory procedures at the system configuration phase;
  • Execution of specified actions on a schedule;
  • Performing a call for a given procedure or asynchronously function, i.e. without waiting for its completion;
  • Tracking the progress of a certain task and obtaining its completion status (values \u200b\u200bindicating the success or not successful implementation);
  • Receiving a list of current tasks;
  • Ability to wait for the completion of one or more tasks;
  • Job management (ability to cancel, lock execution, etc.).

The task mechanism consists of the following components:

  • Metadata of regulatory tasks;
  • Regulatory tasks;
  • Background tasks;
  • Job scheduler.

Background tasks are designed to perform applied tasks asynchronously. Background tasks are implemented by the built-in language.

Regulatory tasks - designed to perform application applications on schedule. Regulatory tasks are stored in the information base and are created on the basis of metadata defined in the configuration. The metadata of the regulatory task contains such information as the name, method, use, etc.

The regulatory task has a schedule that determines which moments of time must be carried out by the method associated with the regulatory task. The schedule is usually set in the information base, but can also be specified at the configuration stage (for example, for predefined regulatory tasks).

The task scheduler is used to plan the execution of regulatory tasks. For each regulatory task, the planner periodically checks whether the current date and time of the schedule of the regulatory task is true. If it matches, the scheduler assigns such a task to execute. To do this, according to this regulatory task, the planner creates a background task that performs real processing.

Background tasks

Background tasks are convenient to use to perform complex calculations when the result of the calculation can be obtained after a long time. The task mechanism has means for performing such calculations asynchronously.

A method that is called when performing a background task is associated with the background task. As a background task method, any procedure or function is not a global general module, which can be called on the server. The background task parameters can be any values \u200b\u200bthat are allowed to transmit to the server. The background task parameters must exactly match the parameters of the procedure or the function it causes. If the background job is function, the return value is ignored.

The background task may have a key - any application value. The key enters the restriction on the start of the background tasks - only one background job with a specific key value and the specified method of the background job method can be performed (the method name consists of the name of the module and the name of the procedure or function). The key allows you to group background tasks that have the same methods, according to a specific applied feature so that within the same group, no more than one background task was performed.

Creating and managing background tasks is performed programmatically from any connection. Create a background task is allowed to any user. At the same time, it is performed on behalf of the user who created it. Receive tasks, as well as expect their completion allowed from any connection to the user with administrative rights, or the user who created these background tasks.

The background task is a purely session object, but does not belong to any user session. For each job, a special system session is created, which is performed on behalf of the user who executed the call. Background tasks do not have a stable state.

The background task can generate other background tasks. In the client-server version, this allows parallelizing complex calculations on the working processes of the cluster, which can significantly speed up the calculation process as a whole. Parallelization is implemented by the generation of several child background tasks with the expectation of each of them in the main background of the task.

The completed successful or emergency background tasks are stored during the day, and then removed. If the number of background tasks running exceeds 1000, the oldest background tasks are also deleted.

Regulatory tasks

Rules are used when it is necessary to perform certain periodic or single actions according to the schedule.

Regulatory tasks are stored in the information base and are created on the basis of the metadata of the regulatory task defined in the configuration. Metadata specify such parameters of the regulatory task as: the called method, name, key, the ability to use, feature a predetermination, etc. When creating a regulatory task, you can additionally specify a schedule (can be specified in metadata), the method parameters, the user name, on behalf of which should Follow the regulatory task, etc.

Creating and managing regulatory tasks is executed programmatically from any connection and allowed only to users with administrative rights.

Note. When working in the file embodiment, create and edit regulatory tasks is possible without launching the task scheduler.

The method is associated with the regulatory task that is called when the regulatory task is fulfilled. As a routine task method, any procedure or function is not a global general module, which can be called on the server. The parameters of the regulatory task may be any values \u200b\u200bthat are allowed to transmit to the server. The parameters of the regulatory task must exactly match the parameters of the procedure or the function it causes. If a function of the regulatory task is a function, its returned value is ignored.

The regulatory task may have a key - any applied value. The key enters the restriction on the launch of the regulatory tasks, because One time among the regulatory tasks associated with the same metadata object, only one regulatory task with a specific key value can be performed. The key allows you to group regulatory tasks associated with the same metadata object, according to a specific applied feature so that within the same group, no more than one regulatory task was performed.

When configuring, you can define predefined regulatory tasks. Predefined regulatory tasks are no different from ordinary regulatory tasks except that they cannot be explicitly created and deleted. If the regulatory task is installed in the metadata sign of predefined regulatory task, when updating the configuration, a predetermined regulatory task will be automatically created in the information base. If the sign of predestination is removed, then a predetermined regulatory task will be automatically deleted when updating the configuration in the information frame. The initial values \u200b\u200bof the properties of a predefined regulatory task (for example, a schedule) are installed in metadata. In the future, when the application is working, they can be changed. Predefined regulatory tasks do not have parameters.

The schedule of the regulatory task determines which moments of time the regulatory task must be launched. The schedule allows you to set: the date and time of the beginning and end of the task, the execution period, the days of the week and months, for which you need to perform the regulatory task, etc. (see the description of the built-in language).

Examples of schedules for regulatory tasks:

Every hour, only one day

PeriodsToistnee \u003d 0, PeriodsTravteraneedyDee \u003d 3600

Every day once a day

PeriodsToistnee \u003d 1, PeriodsTravteraneednya \u003d 0

One day, once

PeriodsTrans: 0.

Every other day once a day

PeriodsOther \u003d 2.

Every hour from 01.00 to 07.00 every day

PeriodsTrans: 1.

PeriodsToresThenate \u003d 3600.

Time \u003d 01.00

Time confer \u003d 07.00

Every Saturday and Sunday at 09.00

PeriodsTrans: 1.

DNNEDELES \u003d 6, 7

Top \u003d 09.00

Every day one week, weekmission week

PeriodsTrans: 1.

December \u003d 2.

At 01.00 once

Time \u003d 01.00

The last number of each month at 9:00.

PeriodsTrans: 1.

Day \u003d -1

Top \u003d 09.00

Fifth number of each month at 9:00

PeriodsTrans: 1.

Timmer \u003d 5.

Top \u003d 09.00

The second environment of each month at 9:00

PeriodsTrans: 1.

Dangened elevate \u003d 2.

DNNEDELES \u003d 3.

Top \u003d 09.00

You can check whether the task is satisfied for the specified date (the method is required to be the Filling of the Schedule Schedule object). Regulatory tasks are always executed on the name of a specific user. If the user of the regulatory task is not specified, then execution is due on behalf of the default user who has administrative rights.

Performing regulatory tasks occurs using background tasks. When the scheduler determines that the regulatory task must be running, then automatically based on this regulatory task creates a background task, which performs all further processing. If this regulatory task is already executed, it will not be launched again, regardless of its schedule.

Regulatory tasks have the ability to restart. This is especially true when the regulatory task method must be guaranteed. Restarting the regulatory task is carried out when it is completed emergency, or when the workflow (in the client-server version) or the client process (in the file version), which carried out the regulatory task, completed emergency. In the regulatory task, you can specify how many times you need to restart it, as well as the interval between restarts. When implementing the method of restarted regulatory task, it must be borne in mind that when restarting its execution will be started from the beginning, and not continued from the moment of emergency completion.

It is important to remember that End time The background task is not completed at the specified time. Some allegations:

* The background task can ignore your automatic cancellation if it does not depend, but continues to work for the reason that not all operations of the platform can be canceled. If the cyclic code of the embedded language is performed, the task can be canceled otherwise not. It all depends on what makes the task. * The end time is the boundary, within which the task can be launched, and not completed? * Forced completion of the task rolls back the changes made by the time the start of the transaction?

Features of execution of background tasks file and client-server versions

Mechanisms for performing background tasks in file and client-server variants differ.

  • In the file, you need to create a selected client process that will be engaged in the execution of background tasks. To do this, in the client process, the function of the global configuration context context function should be occupied. Only one client process on the information database should perform the processing of background tasks (and, accordingly, call this function). If the client process is not created for processing background tasks, then when software access, the task manager will be issued to the job mechanism. The client process that performs the processing of background tasks is not recommended for other functions.

After the client process that performs the processing of background tasks is launched, the remaining client processes get the ability to program the mechanism of background tasks, i.e. Can run and manage background tasks.

In the client-server version, a task scheduler is used to perform background tasks, which is physically in the cluster manager. The scheduler for all the background tasks assigned to perform the background tasks receives the least loaded workflow and uses it to perform the appropriate background task. The workflow is tasked and notifies the scheduler about the results of execution.

The client-server version has the ability to block the execution of regulatory tasks. Blocking the execution of regulatory tasks occurs in the following cases:

  • The information base has a clear blocking of regulatory tasks. Lock can be installed through the cluster console;
  • The information database is set to block the connection. Lock can be installed through the cluster console;
  • From the built-in language, the method of setting monopular () with the truth parameter is called;
  • In some other cases (for example, when updating the database configuration).

Creating a metadata of a regulatory task

Before you programmatically create a regulatory task in the information base, you need to create an object of metadata for it.

To create an object of the metadata of the regulatory task in the configuration tree in the "General" branch for the "Regulatory tasks" branch, run the "Add" command and in the Property Palette Fill the following properties of the Regulatory Task:

The method of the method - indicates the name of the method of the regulatory task.

The key - indicates an arbitrary string value that will be used as the key of the regulatory task.

Schedule - indicates the schedule of the regulatory task. To form a schedule, click the Open link and in the Schedule form that needs the desired values.

The "General" tab indicates the start date and completion date and repeat mode.

The "Day" tab specifies the daily task schedule.

Specify timetables:

  • the start time and time of the end of the task;
  • the completion time of the task, after which it will be forcibly completed;
  • task repetition period;
  • pause duration between repetitions;
  • duration.

An indication of an arbitrary combination of conditions is allowed.

On the weekly "tab, the weekly schedule of tasks is indicated.

Check the checkboxes on the days of the week for which the task will be performed. If you want to repeat the task, specify the repeat interval in weeks. For example, the task is performed after 2 weeks, the repeat value is 2.

The "Monthly" tab indicates the monthly schedule of tasks.

Check the boxes for months in which the task will be executed. If necessary, you can specify a specific day (month or week) execution from the beginning of the month / week or end.

Use - if installed, the task will be executed according to the schedule.

Predefined - if installed, the task is a predetermined job.

The number of repetitions when crashing - indicates the number of repetitions when accidentally completed.

The repeat interval in case of emergency - indicates the repeat interval when crashing. Examples

Creating a background task "Update of the full-text search index":

Background arrangements. Fill ("update induction");

Creating a regulatory task "Restoration of sequences":

Schedule \u003d New Schedule Mallaimation; Schedule. PeriodProducts \u003d 1; Schedule. PeriodPuttoraniyednya \u003d 0;

Task \u003d Regulatory applications. Createrementalization ("recovery sequers"); Task.Maticia \u003d Schedule; Task. recruit ();

Task console

Handling with ITS, manages regulatory tasks:

Work with regulatory tasks

Task objects

Objects of tasks are not reference, but stored in the database in some special storage.

If the "predefined" flag is enabled in the metadata, then such an object is created automatically at launching 1C: enterprises and always exists exactly in one instance. This object cannot be deleted.

If the "predefined" flag is not installed, then objects of such a job are created and deleted software, indicating the schedule and parameters.

Getting a list of tasks

List of tasks can be obtained by Receive fee Global job manager Regulations

ManagedDjobsmanager (ScheduledJobsmanager)

GETSCHEDULEDJOBS

Syntax:

Receive fees (<Отбор>)

Options:

<Отбор> (optional)

Type: Structure. The structure setting the selection. The values \u200b\u200bof the structure can be: unique identifier, key, metadata, predetermined, use, name. If the selection is not specified, all regulatory tasks are obtained.

If the metadata is selected, then as the metadata value, you can specify either the object of the regulatory task, or its name.

Return value:

Type: array.

Description:

Gets an array of regulatory tasks for the specified selection. Obtaining regulatory tasks is possible only for the administrator.

Availability:

Regulatory \u003d regulatory applications. Parcoregments (selection);

For each regulatory out of the regulatory cycle of the newstream \u003d list of lists. Add (); Newstock.Metadae \u003d regulatory. Metadaging. Representation (); Newstroke. Name \u003d Regulatory.Name; New Stroke. Welcome \u003d Regulatory. Welcome; New Stroke. Success \u003d Regulatory.Daccording; Newstroke. USE \u003d RELATING. Equipment; Newstock. Distributed \u003d Regulatory. Distributed; Newstock. Using \u003d Regulatory. USE; New Stall.Identifier \u003d Regulatory.Unoyentifier;

Latest Industry \u003d Regulatory. Following; If the latter<> It is indefinitely a new building. Even \u003d Last president. Incidentally; Newstock. Conduct \u003d Latest Industion. Ended; EndCycle;

Creature

Created by the method of creating a manager of the manager of regulatory tasks:

Regulation \u003d Regulatory applications. Createrementalization (metadata);

Regulation. Name \u003d Name; Regulatory competition. Butter \u003d key; Regulatory competition. Using \u003d use; Regulatory competition. Equipment \u003d Users; Regulatory competition. Ricatics of recruitmentSerialization \u003d quantitators bypromaging; Regulatory competition. IntervalproevarInavorivation \u003d intervator-surveyor-survey; Regulation. Schedule \u003d Schedule; Regulatory competition. recruit ();

Objects \u003d regulatory applications. Createrementalization ("Implementation");

Objects. Name \u003d Name; Objects. USE \u003d truth;

The task object has the "Parameters" field, in which the method parameters are specified:

Regulatory competition (Scheduledjob)

Options Parameters

Using:

Reading and writing.

Description:

Type: array. An array of parameters of the regulatory task. The amount and composition of the parameters must correspond to the parameters of the routine task method.

Availability:

Server, thick client, external connection.

Note:

The ability to read and write is available only for the administrator.

Removal

Delete () object object method:

Regulatory competition. Delete ();

Obtaining a task object

  • list through the method of recoverable fee:

Regulatory \u003d regulatory applications. Parcoregments (selection);

  • through the method of the Find Number of Task Manager:

Task \u003d regulatory applications. SaintPonenikalnodentifier (UID);

Some tasks in document flow and accounting can be performed periodically. For example, in twentieth numbers. Or daily.

Usually, the company is trying to create rules for the fulfillment of such tasks - who, when and how it should fulfill the task to check.

Such tasks are called - regulated, that is, performed according to the regulations.

In IT, monitoring is often regulated.

This is well acquainted with a system administrator - there are special programs that periodically check the operability of servers and network infrastructure and report an SMS or an electronic letter to the administrator.

Similar things exist for webmasters - to verify the availability of the site during the day.

In 1C monitoring tasks and any other periodic tasks that must be executed automatically by schedule, are performed using the 1C Regulations mechanism.

Let's talk about them today.

Regulatory tasks 1C.

The regulatory tasks 1C is that it allows you to perform how it does, but on schedule.

The regulatory task of 1C in the configurator is a way to specify the settings and set a schedule. By the way, the schedule can be changed dynamically then in 1c enterprise mode.

Background tasks can be created from the text of the program in 1C arbitrarily without a 1c regulatory task - for parallel computing on the server.

The execution of 1C regulatory tasks can be disabled temporarily in.

Adding a regulatory task 1c

The regulatory tasks 1C are in the configuration in the branch of General / Regulatory tasks 1C. Add a new regulatory task 1C, indicate its name.

In the property of the regulatory task, 1C method name is indicated, as well as in. The function will be in a shared module with the velocked server installed in the properties, that is, the module must be added in advance.

Property of the 1C Regulatory Task - Task Name - determines the name under which will appear the task in the tasks management tools.

The property of the 1C-key regulatory task is to group several different 1c regulatory tasks. At the same time, only one task with the same key value can be launched. The value itself may be arbitrary. The empty value is not taken into account when monitoring (that is, it is considered not filled).

The property of the 1c regulatory task is predefined - determines that at the start of 1C enterprise, this task will be created in a single instance with the schedule specified in the configurator. Not predefined tasks appear at the time of schedule on the schedule.

In typical configurations, such as editorial accounting 2.0, such regulatory tasks 1C as a configuration update and the transition of the results are predetermined, and such as data exchange or postponed movements are not predetermined.

Usage - Enables the task (that is, it will be executed only if the checkbox is installed).

Repeat when an emergency completion - how it is easy to guess means a restart of the task, if it could not be executed successfully from the first time - it is indicated how many times to restart and after how much after an emergency completion.

Management of 1C and Monitoring Regulatory

To manage the regulatory tasks 1C, there is a special typical processing of the task console. It can be found including on.

This processing refers to the so-called universal external Types of 1C, which are often not included in the configuration, and distributed separately, for example, on ITS disks.

Using the processing of the task console, you can:

  • Enable / disable the execution of the 1C regulatory task
  • Assign / Change Schedule Regulatory Job 1C (Yes, and other parameters)
  • Specify the user 1C, on behalf of which the regulator of 1C will be executed
  • See what tasks when they were made and with what result, the errors of performing 1C tasks
  • Perform the task.

Copies databases and regulatory tasks 1c

If server 1C is used, then the following situation is:

  • For its purposes (for example, for programming), a copy of the working base is made.
  • In the copy of the base, it works, testing and so on
  • Forgets to turn off the regulatory tasks 1c in such a test base.

So far, the regulatory tasks 1c perform tasks associated only with their information base, there is nothing in this.

However, 1C regulatory tasks can save any files data to other databases, exchange, send emails.

In this case, an interesting mixture may be obtained between the result of the execution of 1c regulatory tasks in the work database and copies.

The 1c regulatory tasks for in the work database copies must be disconnected.

Performance and non-fulfillment of 1c regulatory tasks

When creating regulatory tasks, 1C must be remembered:

  • Tasks are performed by themselves - they need to monitor
  • Tasks are performed in the server module
  • Tasks are performed under another Windows user, under other rights.

First, it is necessary to verify that the task is executed and can be executed as a regulatory task 1c.

Secondly, the server module means that many things that are available on the client are not available. For example, sometimes, not all documents can be carried out only on the server, since in their algorithm it may be provided that the user is running manually and not server functions can be used, for example
WARNING ("Hi!")

Third, if the task deals with something outside the 1C database, then the importance of Windows user rights are important, under which the task is performed.

Especially important when developing the third paragraph. If the module cannot be performed on the server - the task will not be performed in principle. To check, you need to start the task at least once again and view the result "task executed" in the processing of the task console.

In the current section, the main shutters for setting up the cluster. Naturally, they are not complete because it all depends on the subtleties of configuring each platform. But still want not to look in the horque, and where did I search it, or how did I ever do it?

  • Failover cluster
  • Scalability of cluster servers

  • Requirements for appointment of functionality

Failover cluster

2.1.7. Load balancing in cluster

2.1.7.1. Available workflow performance

Each workflow has a property. Available performance. It determines how quickly this workflow is capable of performing a reference server call compared to other work processes. The reference call includes the following operations:

● Memory operation: array allocation, array filling, array release.

● File operation: creating, recording, deletion.

● Determines the degree of loading of the computer processors on which the workflow and the number of threads awaiting execution. This value adjusts the execution time of the reference call in the direction of magnification. If the user, on behalf of which the server works, is not included in the group Members of productivity logs (Performance Log Users), then the determination of the degree of processor loading is not performed.

Value property Available performance It is calculated by the division of the number of 10,000 per average (in 5 minutes) the time to perform the reference call to the current workflow. The reference call is performed every 2 seconds if several working servers are present in the cluster. If the server cluster consists of one working server - all workflows are considered equal.

Customers are distributed between work processes so as to make the available performance of all workflows approximately the same. Significant is considered the difference of available performance by more than 25%.

When the ratio is changed between the available performance of workflows, customers are dynamically redistributed between work processes for no more than 10 minutes.

When the workflow is turned off, its customers are dynamically redistributed between the remaining work processes.

2.1.7.3. Requirements for appointment of functionality

2.1.7.3.1. general information

Server cluster provides some set of functionality (called objects of requirements), the distribution of which between the working servers inside the cluster can be controlled. For example, you can specify that all background tasks in the cluster will be performed on the selected operating server.

In order to place the connection or cluster service on a working server, you need to create a functionality assignment requirement for the selected operating server. This requirement determines the possibility or impossibility of a specific server to perform one work. Consider in more detail what is the requirement for the purpose of functionality.

The requirement to assign functionality determines:

● For which object requires a requirement. Some cluster services can act as an object (see), client connections (see) and an arbitrary requirements of the requirement. The following cluster services may appear as an object:

● Locks of objects.

● time.

● registration logs.

● tasks.

● Numbering.

● full-text search.

● Custom settings.

● Session data.

● Transactional locks.

● Work with external data sources via ODBC.

● Work with external data sources via XMLA.

● Licensing service.

● Database configuration background update service.

● Test service.

● External session management service.

● Determines the type of requirements. The type of requirement determines how to use the working server:

● Do not assign - means that the working server for which this requirement has been created will not be assigned to maintain a claim suitable for the conditions specified in the requirement.

● Assign - means that the working server for which this requirement has been created will be one of the candidates for servicing this object (if there are several working servers).

● Auto - means that the working server can be used to maintain the object object if there is no operating server with a clear indication of the need for use.

Council. The type of auto requirement makes sense to use when in the list of operating server requirements there is a requirement with a wider set of conditions, and it is necessary to have a requirement for a narrower set of conditions. For example, this server cannot serve client application connections for all information databases, except for one information base, for which such maintenance is allowed.

● Additional parameters required by the cluster of servers for making a solution in some cases:

● Name of the information base. Used to clarify the requirements for forming requirements for client connections and all cluster services that can act as an object of the requirement, except for the licensing service.

● Advanced parameters. Used to clarify the requirements when hosting a client connection or session data service. The optional parameter is checked on a coincidence with the beginning of the appropriate parameter of the object object. The optional parameter can take one of the following values:

● To specify a specific background job: Backgroundjob.comMonModule. <Имя модуля>.<Имя метода> ;

● To specify all background tasks: BackgroundJob.comMonModule;

● To specify all reports: backgroundjob.report. Specifying the report name is not supported;

● Enter the line or search list: Backgroundjob.systemBackGroundjob;

● To specify the background restructuring: SystemBackGroundJob;

● For client application:

● 1CV8 is a fat client;

● 1cv8cdirect - a thin client in case of direct connection to the 1C: Enterprise server;

● Designer - configurator;

● ComConnection - COM connection;

● WebServerExtension - connection with an information database via a web server: a web client, a thin client in case of connecting via a web server, Web service.

Consider how the server cluster works when processing requirements.

If necessary, placing the object of the claim, the cluster performs the following actions:

● On all servers included in the cluster, the requirements for these servers are set to functionality. Bypass servers and requirements are performed in order of these objects in the cluster console.

● Each list of requirements is defined the first requirement that satisfies the object to be placed: according to the object itself, the information database and the optional parameter.

● Then the resulting list of operating servers is sorted by the type of requirements like the first to be the first work servers with an explicit use indication. Operating servers for which a suitable requirement contains an explicit use ban - are excluded from the list of available working servers. In this case, the purpose is performed as follows:

● There are work servers with a clear use indication: In this case, the object requires one of these working servers.

● No working servers with a clear use of use: An attempt is attempting to use working servers with automatic use or those operating servers for which the requirements are not specified.

● When the client connection is placed, one of which will be selected from the list of available servers, which includes the workflow with the highest available performance (see). Detailed description of the rules for selecting the workflow in a specific working server, see.

The client application, initiated by placing the object of the claim, will be completed emergency in one of the following cases:

● If the Object requires a list of operating server servers turns out to be empty - there is not a single working server that can serve an object. In this case, the requirement will not be posted and an exception will be caused.

● If it is not possible to accommodate the selected server, for example, if the selected server has failed, and there are no alternative working servers.

2.1.7.3.2. Appointment of objects of requirements

Let us consider in more detail the working server assignment algorithm for servicing the cluster service.

● One type service if the service is not divided by information bases.

● Single-type service for one information base if the service is divided by information bases.

● Session data service.

● Licensing service.

Services are distributed between suitable working servers as follows:

● From the list of work servers selected to assign operation servers, those that are currently workable are selected. Among the remaining working servers, those servers are selected in which the priority property contains the maximum value.

● Among the selected working servers, the services are distributed evenly.

● Replication services can be assigned to multiple working servers. The number of operating servers used is equal to the level of fault tolerance of the cluster plus one (see). At the same time, one service will be active, and with other services (backup) will be supported by the replication of service data. Replication is performed asynchronously. Synchronization is performed every second.

● For each session that serves cluster serves, an instance of the session data service is created. When selecting working servers that can serve this service instance, additional requirements are taken into account. From the list available, servers are selected with the minimum number of serviced cluster services. The number of operating servers used is equal to the level of fault tolerance of the cluster plus one (see).

● If you need to use the licensing service, it is necessary to explicitly select the working server to which the program license will be binding and explicitly describe in the requirements of the service on the selected working server.

● The rest of the services are prescribed in a single instance.

Reassigning cluster services between work servers can be performed in the following cases:

● When adding a working server, partial reassignment of services is performed. This reassignment is performed automatically.

● When you delete a working server from a cluster or inaccessibility of the working server, only those objects that served a removable server served. This reassignment is performed automatically.

● When deleting or adding an information base in a cluster, partial reassignment is performed. This reassignment is performed automatically.

2.1.7.3.3. Appointment of workflows

Installing a client application connection with a cluster of "1C: enterprises" servers follows the following rules:

● In accordance with the requirements of the assignment and the restrictions on the use of RAM, the required working server is selected.

Restrictions on the use of RAM are taken into account if the request to install the connection is made to the information base, to which there are no connections on the selected operating server. In case of exceeding the limit of the use of RAM, the working server is excluded from the list if another working server exists that did not exceed the limit. Work servers are also excluded that cannot process the desired compound based on the appointment requirements.

● For the selected server, a list of workflows that are available and can serve the requested connection are determined. The workflow refers to the list of available workflows in the following cases:

● For the workflow, the maximum number of service databases is not achieved (Property Server Property Number of IB per process).

● For the workflow, the maximum number of connections served (the properties of the operating server) is not reached.

● The workflow is not in a state of preparation for an automatic restart.

● From the selected workflows, preference is given to those working processes that are already serviced by the connection of the information base, the connection to which must be served. If there is no such workflow, the workflow is selected with the maximum number of connections serviced.

● If no workflow is selected, a new workflow is started on this work server, which will serve the requested connection.

When you install the connection from the face of an existing session (if it was not possible to reuse the connection of the previous call of the server), preference is given to the workflow that served the previous connection of this session. At the same time, it is possible to select another workflow, if the available performance of another workflow is above the available performance of the current workflow at least 25%.

If on one working server within 20 minutes there are 2 workflows for which the total number of compounds served and various information bases are less than the values \u200b\u200bspecified in the properties of the working server (properties Number of compounds on the process and Number of IB per process), the process that serves a smaller number of compounds will be labeled as outdated and will be stopped after breaking the last connection. Existing connections with "outdated" workflow will be "proposed to leave" the working server at the nearest server call through this connection. At the same time, the "outdated" workflow does not participate in the distribution of requests for servicing new objects.

Regulatory tasks in 1C are designed to perform certain procedures on a schedule, with some frequency.

Regulatory tasks are stored in the information base, have a start-up schedule. The start-up itself is fully automatically performed if the information base is the client-server. If the base is file, then the following steps must be performed:

  • allocate a special user to perform regulatory tasks;
  • the base should be opened under this user, in which the function periodically must be performed Performing acknowledge ().

Creating a regulatory task

Regulatory tasks - 1c configuration metadata object. Located in the General group. Consider the parameters and properties of regulatory tasks.

Method name- The path to the export procedure in the overall module that will be performed on a given schedule. The procedure must be executed on the server. In this regulatory tasks with something similar to the object Subscribe to an event.

Key - allows you to create several regulatory tasks of the same type. For example, performing data synchronization between multiple information bases can be implemented using one metadata object. RegulationAt the same time, several (by the number of exchange bases) will be created by the regulatory tasks. Different these regulatory tasks will be different Key. At the same time, only one task with the same key can be performed.

Using - The flag showing whether the regulatory task is enabled.

Predefined- Here you can draw an analogy with predefined elements of the reference book. Predefined items are created in the configurator and are used by users in operation. Conventional user elements creates himself. With the regulatory tasks in the same way: if it is predetermined, then it exists and can be executed on a schedule immediately after creating in the configurator. If the flag Predefinednot installed, the user needs to create one or more regulatory tasks of this type (for example, through Task console).

Number of repetitions in case of emergency completion - Determines how many times the background task is being restarted if it has been completed with an error.

Repeat interval when an accident failure - Determines which frequency to restart the background task, if it has been completed with an error.

Software work with regulatory tasks

In these examples, we will consider working with conventional, not predetermined, regulatory tasks.

Software creation of a regulatory task

// Create a task
"Mareliamentation") ;

// Install the key of the regulatory task (not required)
The task. Key \u003d "key-out";

// turn on the regulatory task
The task. Use \u003d truth;

// write a regulatory task
The task. Write down ();

Software Obtaining Regulatory Task to change parameters

In this example, we assume that there is only one regulatory task of this type. If the tasks are several, then knowing, it is not difficult to enter the corresponding changes to the code.


"NameGellamentation"] ) ) ;


If tasks. Quantity ()\u003e 0 then
Task \u003d tasks [0];


Otherwise
Task \u003d Regulatory applications. CreaterementName ( "NameGellamentation") ;

Ended;

// Regulatory task is in a variable task. You can change its parameters.

Call dialogue change schedule for regulatory task

There is a special type of dialogue to work with the schedule of regulatory task. We still assume that we have only one regulatory task of this type.

// Get an array with the regulatory tasks of the desired type
Tasks \u003d Regulatory applications. Operational fees (new structure ("Metadata", Metadata. Regulatory applications [ "NameGellamentation"] ) ) ;

// if the task exists, then by the condition it is one
If tasks. Quantity ()\u003e 0 then
Task \u003d tasks [0];

// if the tasks do not, create it
Otherwise
Task \u003d Regulatory applications. CreaterementName ( "NameGellamentation") ;

Ended;

Schedule \u003d task. Schedule;

// Create a dialog for changing the schedule of regulatory task
Dialogress \u003d new dialographersparement (schedule);

// Show the user dialogue and process schedule changes
If dialogress. OpenModally () then
The task. Schedule \u003d dialogress. Schedule;
The task. Write down ();
Ended;

Question: The process of the background task is emercted ...


Good day and good week!)
Company accounting, revision 3.0 (3.0.46.11).
Platform 8.3.9.2033.
When group conducting documents, an error occurs "emergency completed the background task process." No reasons are issued ...
Restarting the SQL server, 1C server (never) does not help ... Maybe who came across such a problem ??? It is even difficult to say after which this error appeared for the group holding (closing the month) was not used for a long time ...

Answer: () () Once again Good afternoon) Included the technological journal and found such interesting things here (maybe aware of what the problem?):
Attempt to perform an operation on an object that is not a socket ...
The process is completed. The outgoing call is prohibited ...
No servers found with placement ...

Question: Background Tasks


Platform 1C: Enterprise 8.3 (8.3.9.2170), Confinal BP 3.0.
Integration is configured through external data sources (DBMS type - OracleDatabase). Added a number of tables from which the NSI, wiring is loaded. Because Data was very much decided to make batch download through background tasks. The size of the portion is 100,000, the package size is 10,000, the number of wiring in the document is 1000, the number of simultaneously working background tasks - 8.
I start, load, everything is OK. But if I put on the night, then the feeling that 1C goes into sleep mode, i.e. After a while, as the log shows, the background tasks are started, but not completed. As a result, it turned out that the tasks were launched at 12 nights, and were completed at 8 am (when I joked) and then continued to be performed further in normal mode. Launched both in thin and in the thick client. The parameters are setting up - the falling time in the passive session 1200, but is it not only the thin client spreads and whether the problem is there? Disable it does not want, because Users do not leave the program, let them fall asleep. Can someone come across a similar problem? How did you decide?

Answer:

There is no such possibility.

Meaning to launch the background task and wait for its completion?
In order not to pay more 8 background tasks?

Drag the "Manager" of the background tasks on the side of the server and let it control ....

Launched on Pentuim D840 40-50 background tasks - normal flight, then already rests on the processor / memory.

Question: how to transfer the file to the background task


Platform 8.3.6.2152
You need to send the file from UV to the background task for subsequent processing.
Done like this:
& Svalette
Procedure Command1 (command) fileDD \u003d New binary (name); AdditivesTrafonaphonic \u003d placement of high-grade (filedd, unique identifier); Starting a load-load-loading serviceer (additives) Extrog Celebrations & Nasserver Function Running a load-load-loading server (AddressLineFound) parameters \u003d New array; Parameters. Addly (additives); Task \u003d background arrangements. Fill ("Money Module.moduphon", parameters method); Endfunction
In the total module:

Mephon procedure (Address) Export Foldd \u003d Removable Purchase (Address); If typny (filedd) \u003d type ("binary") then Eposhell alaregistration Eposhell alaregistration("Debugging", "No DD"); Ended; The endprocesters tried it like this: plated files \u003d new array; Played files. Addly (new description Fixed File (Name File)); Plaid files \u003d new array; If not plays (placed files, placed, false, unique identifier) \u200b\u200bthen refund; Ended; AddressLinefone \u003d plainfiles. Storage; I tried it like this: AdditivesMadlaphonic \u003d placement of time (uncertain, unique identifier); Placel (AddressLineFone, name, false);
From the background to the client through the temporary storage normally transmitted, but from the client in the background - for some reason.

Answer: In general, everything turned out to be quite simple. It can be turned out to be stupidly transmitting bicked as a parameter to the background task. For unqualified lovers, quote a certificate and tell that "so and conceived" the working code:
& Svalette
Procedure Command1 (command) Start-load-loading / server (new two-headed (name)) Extrudresses
& Nasserver Function Running a load-load-loading server (DD) parameters \u003d new array; Parameters. Addly (DD); Task \u003d background arrangements. Fill ("Money Module.moduphon", parameters method); Endfunction procedure Mephon (FileDD) Export If typny (filedDD) \u003d type ("binary") then Eposhell alaregistration("Debug", "there is dd"); Otherwise Eposhell alaregistration("Debugging", "No DD"); Ended; Extrudresses

Question: Starting background task under the desired user


Hello!
There are 1C: Enterprise 8.3 (8.3.11.2924), UT 11.3.4.93 Client - server.
In this configuration of motion on the register "Calculations with clients for documents", it is not performed at the time of the document, and the regulatory task "Performing deferred movements on calculations with customers \\ suppliers."
At the same time, sometimes the regulatory task issued an error, because I tried to make movements in a closed period (earlier the dates of the editing date). In the settings of the regulatory task, a special user has been prescribed from which the ban date is open, after that everything began to work.
However, there is a need to make the data of the registers to be made at the time of the document, and not when the background task on the schedule is launched.
If you run the code itself, which performs a regulatory task when conducting a document, the same error occurs - the period is closed. And if you programmatically run the background task, the starting code at the time of the document, it causes exactly the same error, because The period is closed, and the background task, started programmatically, is started under the name of the current user, and it has a ban point closed. However, when the background task on the schedule is launched, which is installed "the right" user in the planner, then everything goes to bang. This is how to make it programmatically, how to programmatically run the background task under the desired user "through the planner" how do the standard regulatory tasks do, please tell me please?

Answer:

Isn't under the fact that you are configured?
It should be a glitch configuration

Lis2007 said (a):

Hello! At the same time, sometimes the regulatory task issued an error, because I tried to make movements in a closed period (earlier the dates of the editing date). In the settings of the regulatory task, a special user has been prescribed, whose prohibition date is open, after that everything began to work

Click to reveal ...

Question: Debugging background task


The background task is performed with an error. I decided to debug.
run through the external processing with one line:
Background comes. Fill ("Mojamodule. Melting");
The stop point in the module does not come out.
Debugging on the server is allowed, daw in debugging, automatic connection, background tasks - worth it. What could be another problem?

Answer: In general modules there was an appeal to the functions requiring client and non-server execution. I had to put them in brackets # if the client then. Worked and background.

Question: Error when performing exchange


Good afternoon, tell me where to dig:
i carry out an exchange in the accounting basis. About three dozen documents via standard exchange is unloaded from uta. Long think (about an hour) and ends with the message:
emergency completed the process of background task