The maximum permissible memory size of 1C enterprise has been exceeded. Using Performance Metering

SO WHAT HAS CHANGED IN CLUSTER 1C 8.3:

First of all, after installing the 1C cluster, it was necessary to create workflows. As it turned out,cluster processesstarted to be created automatically depending on the load of the database.

A trial run of background jobs of the main database caused the 1C cluster to endlessly overload rphost.exe and the additional rphost.exe did not want to be created. After digging through the settings, everything became clear.

Maximum Workflow Memory is the amount of memory that worker processes can use together. You need to be very careful when setting the parameter, measured in bytes. If you set the wrong value (insufficient for normal user operation) users an error will be thrown "There is not enough free memory on the 1C server". You can also get this error when the memory quota on the 1C server has run out.

Safe memory consumption per call- allows you to control memory consumption during a server call, measured in bytes. If a call uses more memory than expected, this call will be completed within the 1C cluster without restarting the worker process (rphost.exe). Accordingly, the “loser” who made the server call will lose his session with the 1C database without affecting the work of other users.

The amount of work process memory up to which the server is considered productive- at If this parameter is exceeded, the server in the 1C cluster will stop accepting new connections.

Number of information security per process- allows you to isolate information bases for work processes. By default, the current 1C cluster was set to- "8", but over the course of several hours of operation the server became very unstable, user sessions froze. After isolating each infobase (value- "1") the problems disappeared.

Number of connections per process- default value is "128". Since the current base has very huge pressure background tasks (logistics calculations, price list analysis, competitor analysis, etc.), it was decided to reduce the number to “25”.

The settings of the 1C cluster itself have changed slightly:

Fault tolerance level- This the number of working servers that can fail simultaneously without causing users to crash. Backup services are launched automatically in the amount necessary to ensure the specified fault tolerance. IN real mode time, the active service is replicated to the backup ones.

Load sharing mode - there are two options for the parameter: “Priority by performance” - more server memory is spent and performance is higher, “Priority by memory” - the 1C cluster saves server memory.

Instead of an afterword. The 1C 8.3 cluster works noticeably faster and more reliably, creating a user session with the infobase is many times faster, the interface in compatibility mode with 1C 8.2.16 can be said to fly. Of course, there are nuances, but where would we be without them? Good luck in setting up the new 1C 8.3 cluster.

Terms, concepts

Why do you need a 1C server?

The term “server cluster” refers to several computers (servers) performing a common task.

The tasks solved by the 1C:Enterprise 8 server cluster are shown in the figure below.

Difference between 8.1 and 8.2

Cluster 1C 8.1

The 1C:Enterprise 8.1 server cluster is an implementation of the ideas of load distribution on servers serving client requests. This mechanism distributes the load on computing resources within one server or several servers (“Working Servers”), thus ensuring application scaling. The server cluster duplicates the code that serves client connections. The cluster's duplicate executable code is named "Worker Process" (rphost). When installing a cluster, only one worker process is created.
Several worker processes on one server make it possible to effectively use the amount of RAM and processor resources to execute requests, as well as connect a client session to another worker process if the current one “crash”.
The Server Agent (ragent) program is responsible for understanding what is running on a specific server. Stopping the server agent will make the server unavailable for use by the cluster. The agent stores its information in the file srvribrg.lst.
Information about work databases and involved work processes is owned by the “Server Manager” (rmngr). It stores this information in the file 1CV8Reg.lst. Stopping the server manager can lead to a restart of client applications if the manager restarts successfully or to a complete stop of the working servers of the entire cluster.
1C:Enterprise 8.1 allows the possibility of creating several independent clusters on one server. Each of them is identified on the network by a unique “IP port” and a unique number in service files. The first cluster receives port 1541 by default.
The Enterprise Servers snap-in is designed to manage the cluster.
You can connect to servers by server name or IP address.

Server agent

The server agent “knows” about all the clusters that are running on the server. This information is stored in the file srvribrg.lst with a list of clusters and list administrators. The main port of the agent is 1540. On each Working server, only one agent can be launched, servicing all possible clusters on this server.
To get more detailed information visually, use the Process Explorer utility (developed by Sysinternals). The program allows you to take a deeper look inside any running processes, including a 1C:Enterprise 8.1 server cluster.

Cluster Manager

The cluster manager is responsible for the operation of the cluster. Each cluster has its own Manager. The manager stores information about the cluster in the file 1CV8Reg.lst (cluster registry). Each Cluster Manager also has its own port on the Work Server. For the first cluster, the default Manager port is 1541. It is this port that is displayed in the 1C:Enterprise Servers snap-in in the Clusters branch, identifying the cluster.
The manager receives requests from the client part of 1C:Enterprise 8.1 and makes a decision to which Workflow to give this service request.

The Manager uses the service port to interact with worker processes.

The working process

The Work Process is responsible for “working with clients.” We can say that in the previous version of 1C:Enterprise 8.0 there was only one “Workflow”.
There can be several worker processes in a 1C:Enterprise 8.1 cluster. The server manager decides which worker process will serve the client connection. For client connections, Worker Processes are by default allocated a range of IP ports 1560 – 1591. In addition, each Worker Process is assigned a Service port for communication with the cluster manager. Each worker process uses up to 2 Gb of RAM in a 32-bit operating system. In a 64-bit operating system, the limitation is imposed by the physical amount of RAM

Cluster 1C 8.2

Server cluster 1C:Enterprise 8.2 – further development server technologies 8.2.

The server can work “like 8.1”, i.e. it remains compatible with previous technologies.

And plus a new approach to server operation has been implemented. Now, instead of processes, sessions play an important role.

Sessions enable load balancing and fault tolerance within a managed application.

Cluster Manager

The cluster manager has now become more complex. Some functions can now be separated into a separate process and even placed on another working server in the cluster. This allows you to balance the server load.

Server 8.2 fault tolerance is achieved through:

  • Storing information about the user's session.
    • The user is no longer tied to the workflow.
  • Reservation of work processes in a cluster.
    • There should be several worker processes, including redundant ones
  • Cluster reservation.
    • A spare cluster is indicated; when connected, they are listed in the connection line

This allows for continuity of operation:

If the client’s physical connection to the cluster is broken (the cleaning lady pulled out the cable, the power to the network equipment was turned off, there was a problem with the provider), there is no need to reconnect to the infobase and start all the work all over again. After the physical connection is restored, the user can continue working from the point where it was interrupted.

If you want to Maintenance cluster computers, they can be turned off directly during operation without stopping users from working with the information base.

If any server in the cluster fails, user work will not stop; it will be automatically transferred to the backup cluster and/or backup work processes. For users, such a transition will be invisible.

If one of the cluster's worker processes fails, users connected to it will be automatically transferred to other or backup worker processes. Such a transition will also be invisible to users.

Cluster 1C 8.3

Server 8.3 is characterized by a newly redesigned internal code, although “from the outside” it may seem that it is a slightly modified 8.2.

The server has become more “auto-configurable”; some parameters, such as the number of worker processes, are no longer created manually, but are calculated based on the descriptions of the requirements of fault tolerance and reliability tasks.

A load balancing mechanism has been developed, which can be used either to increase the performance of the system as a whole, or to use a new “memory saving” mode, which allows you to work “with limited memory” in cases where the configuration used “likes to eat up memory.”

Stability of operation when using large amounts of memory will be determined by the new parameters of the production server.

The “safe memory consumption per call” parameter is especially interesting. For those who have little idea what it is, it’s better not to train on a “productive” basis. The “Maximum memory size of working processes” parameter allows, in case of “overflow”, not to crash the entire working process, but only one session “with the loser”. “The amount of working process memory up to which the server is considered productive” allows you to block new connections as soon as this memory threshold is exceeded.

I recommend isolating work processes by information base, for example, specifying the parameter “Number of information security per process = 1”. With several highly loaded databases, this will reduce mutual influence both in reliability and performance.

A separate contribution to the stability of the system is made by the “expenditure” of licenses/keys. In 8.3 it became possible to use the “manager software licenses”reminiscent of the manager of “aladin”. The goal is to be able to place the key on a separate machine.

It is implemented as another “service” in the cluster manager. You can use, for example, a “free” laptop. Add it to the 1C 8.3 cluster, create a separate manager on it with the “licensing service” service. You can insert a hardware hasp key into your laptop, or activate software licenses.

Of greatest interest to programmers should be the “Functionality Assignment Requirements”.

So on a laptop with a security key, in order not to launch users on the cluster server, you need to add “requirements” for the requirement object “Client connection to information security” - “Do not assign”, i.e. deny worker processes of this server handle client connections.

Even more interesting is the ability to run “background jobs only” on the cluster’s production server without user sessions. This way you can move highly loaded tasks (code) to a separate machine. Moreover, you can have one background task “closing the month” through “Value additional parameter" run on one computer, and the background job "Updating the full-text index" on another. Clarification occurs by specifying the "Value of the additional parameter." For example, if you specify BackgroundJob.CommonModule as a value, you can limit the work of the worker server in the cluster to only background jobs with any content. BackgroundJob.CommonModule value.<Имя модуля>.<Имя метода>- will indicate a specific code.

Solving possible installation problems

When installing the 1C:Enterprise 8.1 server part, you can create a new user or select an existing account.

If you select an existing account you must provide the correct password and confirmation, otherwise running the server side further will result in an error.
When you run the Cluster Agent for the first time, a default cluster is created.
The default cluster has the following characteristics:
· port number – 1541;
· IP port range – 1560:1591;
· support for many workflows – disabled;
· one worker process, the port number is set from the specified range.
If there are any problems when you first start the Cluster Agent, the default cluster may not be created. This manifests itself in the fact that when the server agent (ragent) starts, it starts, but does not start other cluster processes (rmngr, rphost). The list of clusters srvribrg.lst looks like this:
{
{0},
In this case, you can stop the ragent process, delete the list of clusters (srvribrg.lst) and start ragent again.

Check that the ports specified in the port parameter match command line starting the server agent service and the one specified in the central server parameters dialog of the cluster console:

— Stop the 1C:Enterprise 8.1 Server Agent service.

If the Server Agent is running as an application, it can be stopped by pressing the Ctrl+C key combination.
- Make sure in the Task Manager that all processes ragent, rmngr, rphost have ended. If necessary, complete them using Task Manager.

— Open the properties of the 1C:Enterprise 8.1 Server Agent service.

- Pay attention to the line " Executable file"(Path to executable). It has the -d parameter followed by the cluster data directory. All files related to the cluster are located in this directory.
- Delete all contents of this directory.
— Start the 1C:Enterprise 8.1 Server Agent service.
- Make sure in the Task Manager that all processes ragent, rmngr, rphost have started.
— Launch the cluster console and register the central server in it. The console should connect to the central server and show one cluster created by default.
Possible problems with the failure of the Server Cluster include problems with security keys, service account rights, and incorrect startup parameters.

  1. The server protection key is installed LOCALLY on each server in the enterprise
  2. Don't set a service account with a blank password
  3. With multiple clusters, the ports used should not overlap

Please note that during the installation process of the 1C:Enterprise 8.1 platform, error messages may be displayed. The most likely messages are listed below. The reasons that caused the messages and steps to eliminate them are indicated.

Error 1069: The service is not running due to a login error

The problem is related to the account's rights to run as a system service. Open the Local Security Policy utility ( Local politics security) and add the user (on whose behalf the Cluster Work Servers are launched) to the Logon as service and Logon as batch job policies.
If the data stored in service files is damaged, the start of the Cluster's Production Servers may fail. Make sure that the 1C:Enterprise 8.1 server agent is running (ragent process in Task Manager).
Don't forget that audit is also a means of analysis. Windows events. To do this, look to see if any “suspicious” messages appear in the Windows event log.

Error 8007056B / 800708C5

The new password does not meet the password policies. The password may be too short or you have already used this password recently.
Reason: the specified password for the account in the “Install 1C:Enterprise server” dialog box does not meet the requirements of the security policy.
Solution: Set New Password for the selected account, satisfying the requirements of the security policy, or relax the requirements of the applied security policy, i.e. do not require a “complex” password, do not limit the number of characters in the password, do not check repetition attempts, etc.

Error 1923: No privileges to install by service

Cause: The error is related to the account's installation rights as applications. This error is typical for attempts to install a server on a domain controller where increased security measures are required.
Solution: Do not use a domain controller to host the enterprise server, or relax the security requirements and specify the “Run as a service” or “Run as a batch job” rights for the selected account.

Error 80070056

Your password could not be changed. Each password must be used for at least x days.
Cause and Solution: Another error that occurs when the security policy requirements for the passwords used are violated. The solution is similar to error 800708C5.

Windows Sockets - 11004(0x00002AFC)

1) Make sure that on the Working server of the cluster in the Task Manager the following are running:
Server agent (ragent.exe),
Cluster Manager (rmngr.exe),
Cluster worker process (rphost.exe).
2) To check IP address name resolution, run on the command line:
ping machinename
In the system's response to the command, we are interested in determining whether the IP address is determined.
3) If the name is determined, but the Worker Process is still not found, then make sure that the IP address of the name is determined<имя машины>And<имя машины>.<имя домена>are not defined differently.

(Windows Sockets - 10054(0x00002746).

The remote host forcibly closed the connection.
This message may be received if the server is rebooted or the Worker Process is forced to be deleted.
This error usually does not appear when reconnecting. If the error remains, it is necessary to investigate the reasons for the failure of the cluster's production servers.
This error can occur when a worker process reaches the maximum memory capacity on 32-bit systems.
Another case is a connection attempt from a client with an error message:

(Windows Sockets - 10060(0x0000274C)

An attempt to establish a connection was unsuccessful because... the required response was not received from another computer within the required time, or an already established connection was terminated due to an incorrect response from the already connected computer.
The essence of this error is the lack of response within a certain time (timeout).
1) Make sure your firewall is not blocking application traffic. Turn off your firewall.
To do this, run the command on the command line (the command is available starting from Windows XP and Windows Server 2003, more earlier versions There is no built-in firewall, but third-party software can be installed):
netshfirewallsetopmodedisable
If the command is successful, you will receive a message:
OK.
In addition to the firewall, they can block traffic network filters. They are disabled by default. However, make sure it is like this:

  1. Open the Network Connections folder.
  2. Right click network connection that you want to configure and select the command Properties.
  3. On the tab Are common(for connection via local network) or on the tab Net(for all other connections) select Internet Protocol (TCP/IP) and press the button Properties.
  4. Click the button Additionally.
  5. Open the tab Options, select an option TCP/IP Filtering and press the button Properties.
  6. Make sure the checkbox Enable TCP/IP filtering (all adapters) removed.

2) Make sure that the processor resources are not 100% loaded (CPU%).
3) Measure the network activity of the client and server interfaces. Stress on network adapter should not exceed 60%.

(Windows Sockets - 10061(0x0000274D)

The connection has not been established because The destination computer rejected the connection request.
A typical reason for this error is the absence of a running Server Agent. Start the server manually or reboot the server to start automatically.

Answers on questions

Multiplatform 1C

Server installation

Q: Error installing 1c server on MS Server 2008 R2 x64 When installing 1c server via the command line, for example, ragent.exe -instsrvc -port 2040 -regport 2041 -range 2060:2091 -d “C:\Program Files\1cv82\ (taken from the ITS disk), the command line writes the message: “Error! OpenSCManager error!” The service is not created in this case. Tested on 8.1.15.14 and 8.2.10.77

A: To install from the command line on an OS where UAC is present, you need to use the RunAs service, because Even if the user is a member of the Administrators group, UAC blocks actions that change the system state.

Protection keys

Q: Does the protection key for Server 8.2 allow me to run Server 8.1?
A: Yes, it does

Q: To start a 1C server, do I need some kind of server hasp keys? Local, or will it not work for 5 users?

A: yes, the server needs its own key, local user and network keys will not work. More details in « « , slide number 30.

Q: let’s say a 1c server cluster consists of 3 physical servers. how many security keys are needed?

Q: There is a terminal server and a key for 5 licenses, a 6th additional license must be purchased. license. Is it possible to install it on the server next to the key at 5? And will all 6 users work in terminal sessions or 5 - under the terminal, and 1 in the file version?
A: No, they won't. The 6th license in the form of a local key must be plugged into the user’s computer, but not into the terminal.

1C server updates

Q: upon exit new version 8.2.xxx platforms what is the procedure for updating servers and clients
A: 8.2 distributions install their files in different folders (each version has its own folder), i.e. theoretically, it remains possible to call several versions of the server in parallel.

I didn't have any problems. However, you need to carefully monitor the ports occupied by the 1C server instance. There should be no intersections.

Setting up 1C server

Q: In 1C 8.1, what is the best way to place infobases, if there are several of them, in one cluster or create a separate cluster for each database? A: With a large volume or load, test databases must be placed in separate clusters!

Q: QUESTION: Is the 1C:Enterprise 8.1 workflow a single-threaded application or a multi-threaded one? Those. can many cores be loaded with one connected user? With several? What about the 1C:Enterprise 8.2 workflow? Thank you.
A: 1Сv8.exe and rphost.exe in version 8.1 consumed 1 core. Since in 8.1 the client connection is strictly tied to the worker process, we can conditionally assume that 1C client processing is performed within a single core. The exception is the DBMS, which uses kernels regardless of how the 1C server works.

In version 8.2, connections are replaced by sessions. Sessions may already be running in different worker processes. Therefore, calling 8.2 single-threaded is probably not correct. Client 8.2 also visually loads several cores, so this:

platform 8.2 does not implement all the capabilities of a multi-threaded system, but it makes much better use of hardware capabilities compared to 8.1, including in terms of parallelism.

Q: Is it necessary to have multiple 1C:Enterprise 8.1 work processes for the database server (MS SQL) to load multiple cores? (It is noted that MS SQL usually “loads” only one core, i.e., “parallelizing” the processing of one request across several cores, as a rule, does not occur.) Thank you.
A: There is no need to specifically manage MS SQL; it is a fairly self-tuning system that uses resources as needed. You can control execution parallelism:

EXEC sys.sp_configure N’max degree of parallelism’, N’5′
GO
RECONFIGURE WITH OVERRIDE
GO

You can create several work processes on the 1C server based on the fact that one work process does not provide the ability for users to reconnect in case the work process crashes. Process 2 (on 8.2 it is better to make it “backup”) solves this problem. But it makes sense to add a third or more work processes only if the first two work processes are heavily loaded (more than 90%). There is no point in multiplying work processes unnecessarily; this can worsen productivity.

A: There must be at least 1 backup worker process in 8.2.

Failover Cluster

Q: Question about enabling redundancy for 1s 8.2 clusters. If our server crashed (the cleaning lady pulled out the wire), then the network name, for example “server:2540” will be unavailable. How does a client whose connection string says “server:2540” know that it needs to connect to the backup cluster? where will he get the name of the other server? What if you write clusters separated by commas in the database connection string?
A: Several clusters are combined into a “redundancy group”. For this purpose, there is a “reservation list” in the cluster snap-in.

When a client first accesses a cluster, it is given a list of clusters included in the redundancy group.

If the client has never contacted you, then in this case you need to manually specify the addresses of all clusters, for example storm:2541,monster:2541.

Synchronized data is exchanged between redundancy clusters.

Q: What happens after the main cluster is restored? when users switched to backup.

A: They are going back. There may be pauses during switching while synchronizing these clusters.

Background jobs

Q: How to delete a background job running on servers 1C:8.1 and 1C:8.2?

A: Possibility of cancellation regulatory task works only if the code is executed within the built-in 1C:Enterprise language. If the code is executed in external libraries, then such a task cannot be canceled except by forcefully terminating the workflow. If in the process there is a block StartTransaction() - CommitTransaction(), then it’s unlikely. Other background jobs can be deleted through the job console.

Regulatory procedures

Q: Is it possible to destroy the base during T&I?

A: I am not aware of such cases, but IMHO anything is possible. Therefore, it would be a good idea to make a backup before T&I.

Q: Vyacheslav, for what reasons do you not perform reindexing using 1C Testing and Correction?
A: DBMS capabilities are better suited for these purposes, since they essentially also rebuild indexes, but do not require exclusive seizure of the database.

Technology magazine

Q: Good afternoon. Question from a technology magazine: I need to receive copies of workstation screens in case of 1C errors. Do I need to set up a technological log on workstations for this, or is it only for the server?
A: You can only configure receiving a screenshot when the platform falls, and not when there is any error. However, there is not much usefulness in such an operation; it is quite enough to collect exception situations using a technological log. At the same time, most of the errors can be seen using TZ on the 1C server side. An exception would be events such as a "format stream error" associated with an outdated metadata cache.

Problems and errors

Q: Have you encountered a problem - the disappearance of report settings for users when dynamically updating configurations on the 8.2 platform. Any recommendations on how to deal with this?
A: Problems related to dynamic updating are reflected in “1C Servers: Enterprise 8.1 and 8.2 - what to eat with “), slide number 60. Clear cache. Perhaps in some cases it is necessary to understand where exactly user settings are stored. If necessary, store as binary data in the information register.

Q: A related question, because... this is relevant for file mode: What errors does chdbfl.exe fix?
A: This is a data storage structure error correction tool. This could be a situation where, for example, “The database file is damaged.../1Cv8.1CD” appears. Those. fixes database file corruption. However, it does not perform T&I functions. I run chdbfl.exe if the T&I does not run successfully.

Q: Please tell me if you have encountered such a problem. while in the database large quantity users (about 40) when carrying out large documents, for example, reflecting the PO in the reg. Accounting for about 8000 lines. The error message is that there is not enough memory on the enterprise 1C server and the user who initiated this document falls off. The document can then be processed only after restarting the 1C server agent.
A: Looks like memory leaks:

1. Restart the 1C server, increase the number of worker processes, and keep only this one database in the cluster.

2. Beat the holding in portions, say 1000 lines at a time. Using TZ, track objects that occupy memory at the beginning of an operation, but do not release memory upon completion.

3. Install the x64 version, increase the amount of RAM, switch to 8.2.

Q: Question about testing and management. Is it possible to run “Referential Integrity Check” based on the URDB with selection based on the transmitted data? (i.e., in some nodes there are physically no objects, but there are links to them). Thank you!
A: Unfortunately, this is not possible yet.

Q: Why doesn’t testing and fixing solve all the issues at once, do you have to run it several times?

A: Only developers can answer accurately. I run T&I according to regulations (cyclically), so this issue is not very relevant for me. T&I must be done not just once, but constantly, like “MOT for a car.”

Q: Is there a difference between T&I 8.1 and 8.2?

A: At the moment of writing the answer and release 8.2.10, I do not know the difference.

Q: Is it necessary to reindex during restructuring?
A: No need.

Other

Q: Dear sirs, has anyone tried to mirror databases using MSSql 2008? Is it even possible?

Q: Question about forcing shared memory on server 1s 8.2

A: There is no need to force anything, the server will understand.

Q: For 1C:Enterprise 8.1, situations have been noticed when on the same hardware the file-server version with “heavy” operations and a single user works much faster than the client-server version, when all “links” (database server, 1C:Enterprise server and client) are installed on one server. Moreover, when performing this “heavy” operation, there are no obvious hardware overloads (processor load, memory load, hard drives minimum). That is, there are a lot of hardware resources, but it works slowly. What can we “rest against”? Thank you.
A: The advantage of the client-server architecture from a performance point of view is the ability to process client requests for data in PARALLEL. Those. Flow speed is not an indicator on which to draw general conclusions. Mechanisms that improve concurrency may still slightly reduce performance within a single thread.

In order to definitely find the bottleneck in your case, you need to get the workload server equipment and compare in time with the longest operations in client-server mode. Often this is an excessive movement of data to the client side. Those. Instead of performing operations on the 1C server, data from the database is transferred through the server to the client.

The speed in one thread of the client-server version will only catch up with the performance of the file version. It is worth tackling this problem if the operation time in absolute numbers is measured in no less than minutes. Optimizing within 1-3 second queries is doubtful.

Q: About the difference between the Windows terminal and the 1C thin client.
A: Until most solutions are COMPLETELY translated to 8.2, it is definitely difficult to talk about a practical comparison of these technologies.

It is clear that the 1C thin client should consume less traffic and provide the ability to work via the web. But this is something that has yet to be implemented, and terminal solutions are being used very widely now.

For conservative, pragmatic project managers converting 8.1 to 8.2 - a terminal solution. For small projects with low cost of errors and configuration immediately implemented with controlled forms and SKD - a thin client is preferable IMHO.

Q: How to conduct load testing close to real conditions? After all, you can’t force users to “click something.”

A: 1C: Test center with a selection of the most difficult operations, 100% reproduction is not necessary, the clicks themselves are not difficult, mainly conducting and requesting reports. There will be a separate webinar on testing. I’ll also tell you in more detail.

Print (Ctrl+P)

In this article I review the main activities that need to be performed to increase 1C performance in the client-server version of 1C:

  1. Increase in hardware capacity.
  2. Setting up a 1C:Enterprise server
  3. SQL Settings servers
  4. Optimization of code and algorithms in 1C.

1. Increase in hardware capacity

Minimum requirements for computers submitted for certification to company “C” to receive the “Compatible! 1C:Enterprise software system" written

1C server performance: the enterprise is quite dependent on the processor frequency, and for a database server the computer characteristics must meet the requirements Microsoft SQL Server, PostgreSQL, IBM DB2, Oracle Database.

2. Setting up the 1C:Enterprise server

Instructions for setting up working servers with the 1C:Enterprise Technology Platform can be found on the ITS disk

In version 8.3, several new parameters were added to configure production servers:

  • Maximum Workflow Memory. The setting allows you to regulate the amount of memory that can be occupied by all worker processes of a given cluster on a given working server.
  • Safe memory consumption per call. The setting allows you to limit the amount of memory that will be occupied when making a server call on a given working server.
  • Number of information security per process and number of connections per process. These settings allow you to indirectly regulate the number of worker processes on a given working server.
  • Manager for each service. The configuration allows you to run each cluster manager service as a separate process.

3. Setting up SQL server

Peculiarity Microsoft settings Sql Server can be viewed on the ITS disk to increase performance

Using the Maintenance Plan in the Management section, you must perform the following routine tasks to improve productivity:

  • Defragmentation of indexes and updating statistics must be done daily, because if index fragmentation is > 25%, it dramatically reduces server performance.
  • Defragmentation and updating statistics is done quickly and does not require disconnecting users. It is also recommended to do it daily.
  • Full re-indexing – done with the database blocked, it is recommended to do it at least once a week. Naturally, after complete reindexing, the indexes are immediately defragmented and statistics are updated.

3.1 Analysis of the degree of index fragmentation

Excessive index fragmentation creates problems for large I/O operations. After performing intensive operations to modify data in database tables, the execution time of queries and data modification operations increases.

This is due to the fact that such operations modify the indexes, which leads to their fragmentation and an increase in the number of I/O operations when using indexes during data read and write operations.

For efficient use of indexes Microsoft SQL Server required

  • Regularly reindex database tables using the command DBCC DBREINDEX ( table_name ) .
  • Regularly defragment database indexes using the command DBCC INDEXDEFRAG (database_name, table_name, index_name) .

The choice of how to solve this problem depends on the intensity of operations to modify database tables.

MS SQL Server 2005 has new tools to control this parameter.

Dynamic control table function sys.dm_db_index_physical_stats returns the percentage of fragmentation in a column avg_fragmentation_in_percent. If the value in this column is greater than 25%, we recommend defragmenting this index to restore original performance. Large range scan operations common in data warehousing and reporting applications can benefit from reduced index fragmentation.

Using this information can significantly reduce system load and avoid unnecessary defragmentation operations for indexes that do not require it.

3.2 Physical memory usage greater than 2 GB in Microsoft SQL Server

Microsoft SQL Server 2000 Standard Edition and Microsoft SQL Server 2005 Workgroup Edition can use up to 2 GB physical memory, which is dynamically allocated and released depending on the workload. As the database size increases, this amount of RAM becomes insufficient to effectively cache data and maintain acceptable performance.

3.3 Reducing the Microsoft SQL Server Transaction Log Size

Performing intensive operations to modify infobase data leads to an increase in the size of data files and the transaction log. At some point in time, old transaction log entries are no longer needed for database recovery and can be deleted, thereby freeing up space for new entries. If you do not promptly delete old transaction log entries, then after some time the transaction log file may take up all the free disk space and work with the database will become impossible.

To reduce the log file size, you must first delete inactive transaction log entries using the command BACKUP LOG, and then using the command DBCC SHRINKFILE reduce the size of the transaction log file. The sequence of commands to be executed in Query Analyzer, as follows:

BACKUP LOG Database_Name WITH TRUNCATE_ONLY

DBCC SHRINKFILE(Transaction_Log_File_Name)

3.4 Moving the TEMPDB database to another larger disk.

TEMPDB is a system database Microsoft data SQL Server, which stores temporary tables created both by the server itself and by users. This database is recreated every time Microsoft SQL Server is restarted. By default, the size of this database is unlimited and it is increased automatically, if necessary, in portions of 10% of the current TEMPDB size. However, these parameters can be overridden by the user. By default, the minimum size of this database, which is set when Microsoft SQL Server starts, is determined by the size of the MODEL system database. Transaction log purging for this database is automatic and only deletes inactive transaction log entries.

When running 1C:Enterprise 8 in client-server mode, temporary tables are widely used . Additionally, TEMPDB is used by Microsoft SQL Server when executing queries that use the statements GROUP BY, UNION, DISTINCT and so on.

During the operation of 1C:Enterprise 8, a significant increase in the size of the TEMPDB database is possible. If the size of the disk on which the TEMPDB database is located is insufficient, 1C:Enterprise 8 may crash.

If this problem occurs regularly, then it is recommended to move TEMPDB to another larger disk.

This operation can be performed in the following way:

1. determine the logical names of the TEMPDB database files (the “NAME” column of the procedure result). To do this, you need to run the following command in Query Analyzer:

USE tempdb GO EXEC sp_helpfile GO 2.change the location of the TEMPDB database files using the command ALTER DATABASE. To do this, you need to run the following sequence of commands in Query Analyzer: USE master GO ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev,FILENAME= "New_Disk:\New_Directory\tempdb.mdf") GO ALTER DATABASE tempdb MODIFY FILE (NAME = templog,FILENAME= "New_Disk:\New_Directory\templog.ldf") GO 3. Restart Microsoft SQL Server.

4. Optimization of code and algorithms in 1C

4.1 Query optimization

A significant portion of the problems that cause queries to perform suboptimally can be detected by analyzing the configuration code and metadata structure. There is a list typical mistakes in code and data structure, the consequences of which are well understood and easily predictable. Code analysis using this list can solve most query performance problems without going into detail. technical information(SQL query text, query plan, etc.).

The main reasons for non-optimal query performance, diagnosed at the level of configuration code and metadata structure, are discussed on the ITS disk:

  • joins with subqueries
  • connections to virtual tables
  • mismatch between indexes and query conditions
  • using logical OR in conditions
  • using subqueries in a join condition
  • receiving data through a dot from fields of a composite type
  • filtering virtual tables without using parameters

4.2 Using Performance Metering

1C:Enterprise 8 allows you to debug and measure performance for code in the built-in language, executed on both the client and the server. A special feature of performance measurement for a client-server infobase in 1C:Enterprise 8 is that the performance measurement results are combined into one file. They include data about the execution progress of code in the embedded language on both the client and the server. To obtain such a measurement, it is enough to launch the 1C:Enterprise 8 server in debug mode (using the command line switch /debug) and in the Configurator, at the right time, simply enable the performance measurement mode.

The performance measurement mode in 1C:Enterprise 8 allows you to successfully optimize the operation of client-server applications. To perform such optimization, it is enough to perform just a few steps, then analyze the results of performance measurements and move on to improving the code in the built-in language.

More details about using performance measurements can be found on the ITS disk.

Before starting system optimization work, you should always obtain an initial performance assessment using the “APDEX Integrated System Performance Assessment”.

4.3 Code refactoring tools

Code refactoring functions implemented in the platform configurator 8.3.5, 1068, as well as functions for automatic conversion of modal methods and code sections are shown in Figure 1.

Fig 1 Code refactoring tools in the configurator

The platform developers explain the need for these tools by the fact that the code of application solutions must be understandable, especially when a group of several developers is working on the configuration. Then program code easy to maintain and modify.

Please note that the cluster settings are responsible for the settings of all servers belonging to the configured cluster. A cluster involves the operation of several physical or virtual servers working with the same information databases.

Restart interval– is responsible for the frequency of restarting cluster worker processes. This parameter must be set when the server is running around the clock. It is recommended to associate the restart frequency with the technological cycle of the cluster infobases. Typically this is every 24 hours (86400 seconds). As you know, work processes of 1C servers process and store work data.

Automatic restart was designed into the platform "to minimize the negative effects of fragmentation and memory leaks in workflows." The ITS even has information on how to organize the restart of work processes based on other parameters (memory size, occupied resources, etc.).

Allowed memory size– protects 1C servers from memory overuse. If the process exceeds this volume in range of exceeding the permissible volume, the process is restarted. Can be calculated as the maximum memory size occupied by "rphost" processes during periods of peak server load. It is also worth setting a small interval for exceeding the permissible volume.

Permissible deviation of the number of server errors. The platform calculates the average number of server errors in relation to the number of calls to the server within 5 minutes. If this ratio exceeds the permissible value, then the workflow is considered "problematic" and can be terminated by the system if the flag is set “Forcibly terminate problematic processes.”

Stop disabled processes after. If the permissible amount of memory is exceeded, the worker process does not terminate immediately, but becomes “turned off” so that there is time to “transfer” the working data without loss to the new running worker process. If this parameter is specified, then the “turned off” process will in any case terminate after this time has elapsed. If you observe “frozen” work processes in the operation of the 1C server, then you can set this parameter to 2-5 minutes.
These settings are set for each 1C server individually.

Maximum Workflow Memory– this is the volume total memory that can be occupied by worker processes (rphost) on the current cluster. If the parameter is set to “0”, it takes up 80% of the server’s RAM. “-1” - no restrictions. When a DBMS and a 1C server are running on the same server, they need to share RAM. If during operation it turns out that the DBMS server does not have enough memory, then you can limit the memory allocated to the 1C server using this parameter. If the DBMS and 1C are separated by servers, then it makes sense to calculate this parameter using the formula:

“Max volume” = “Total RAM” – “ RAM OS";

“OS RAM” is calculated on the principle of 1 GB for every 16 GB of server RAM

Safe memory consumption per call. In general, individual calls should not take up all the RAM allocated to a worker process. If the parameter is set to “0”, then the safe flow rate will be equal to 5% of “ Maximum memory capacity for working processes". “-1” - without limitation, which is highly not recommended. In most cases, it is better to leave this parameter at “0”.

Using parameters “Number of information security per process” and “Number of connections per process” you can control the distribution of 1C server work among work processes. For example, run for each information base a separate “rphost” so that in case of process crashes, only users of one database are disconnected. These parameters should be selected individually for each server configuration.

Limitation on the use of RAM by the DBMS server– The MS SQL DBMS server has one remarkable feature - it likes to load databases with which it is actively working completely into RAM. If you don't limit it, it will take all the RAM it can.

  • If the 1C:Enterprise server is installed together with Microsoft SQL Server, then the upper memory threshold must be reduced by an amount sufficient for the operation of the 1C server.
  • If only the DBMS is running on the server, then for the DBMS according to the formula:

“DBMS memory” = “General RAM” – “OS RAM”;

Shared memory– a lot is known about this parameter, but it still happens that people forget about it. We set it to “1” if the 1C server and the DBMS operate on the same physical or virtual server. By the way, it works starting from platform 8.2.17.

Max degree of parallelism– determines how many processors are used when executing one request. The DBMS parallelizes data retrieval when executing complex queries on multiple threads. For 1C it is recommended to set it to “1”, that is, in one thread.

Auto-extension of database files- we determine the step in MB with which the database file is “expanded”. If the step is small, then with active growth of the database, frequent expansions will lead to additional load on the disk system. It is better to set it to 500 – 1000 MB.

Reindexing and defragmenting indexes– it is recommended to defragment/reindex at least once a week. Reindexing locks tables, so it is best to run during non-working hours or periods of minimal load. There is no point in doing defragmentation after rebuilding the index (reindexing). According to Microsoft's recommendation, defragmentation is done if index fragmentation does not exceed 30%. If higher, it is recommended to reindex.

Power plan– in power settings operating system set to high performance.

Start