How to set up smartphones and PCs. Informational portal

Updating 1c on a virtual machine. Virtual environments and 1C

Initially, virtualization was only at the software level and the advantages of virtualization were offset by a significant slowdown in a virtual environment. Partially the issue was solved by hardware - vendors developed instructions for Intel VT-d, AMD-V processors, etc. to speed up work. However, memory and processor are not the only components, there is also a video card, hard drives, etc. and the speed of operations directly depends on the implementation of access to them. Those. Depending on the manufacturer of the virtual machine, drivers from the manufacturer of the equipment, and the ability of the final software to recognize virtualization, the speed of work still depends significantly.
Different applications slow down in different ways in the virtual machine.
In addition to the hardware overhead of maintaining virtualization software, another slowdown factor is the organization of the passage of time. The flow rate in the physical gland and the viratual are not the same. Plus, the virtual machine can be paused. The complexity of the implementation of timers, synchronizer switches, the interception of physical hardware resources in a virtual system does not allow solving the problem one-to-one as on physical hardware, a lot depends on the specific vendor.

We conducted a streaming speed test to assess how much virtualization can affect the speed of single-threaded tasks in 1C, including front-end operations.

From the results obtained, the most important conclusion is not numbers, but the fact that experience is still required to grope in practice, and not the theoretically optimal option for operating 1C for your specific load.
The influence of the virtualization layer is especially noticeable on very fast 1C infobase operations, and this is logical. The shorter the operation time, the more it compares to the latency for servicing the virtualization layer.
In other words, if we perform one long operation for a thousand seconds, then a tenth lag for the maintenance of virtualization will be a drop in the ocean and will not be noticeable. But if we perform ten thousand operations with the time of each operation one tenth of a second, then the service delays will be noticeable as they will be commensurate with the duration of the operation.

WHAT TO DO

There are two ways to solve the problem.
1st way. If the virtualization settings fail to achieve the desired performance, use physical hardware.
2nd way. Minimize virtualization lags by choosing settings that match the nature of the load. At the same time, one must understand that virtualization is not 100% analogs of physical equipment, and it is necessary to compensate for the speed with more powerful physical equipment.
Some vendors provide speed gains with caching mechanisms built into the virtualization layer. However, the cache can be "broken" and then there will be a sharp drop in performance. Those. one must remember not only the pros of technology, but also the cons.

1. "Snapshots" must be turned off - they slow down. Moreover, the influence is far from obvious. For details see http://vkeygen.blogspot.ru/2011/10/snapshot.html

Microsoft Hyper-V

- when using Hyper-V servers with NUMA nodes

VMware ESXi & vSphere

Sharing virtual machines for load balancing
The problem lies in the work of the vCenter component called DRS (Distributed Resource Scheduler), whose task is to balance the load of virtual machines on physical servers.When there are large loads on processor power or on RAM load, DRS migrates the virtual machine to another physical host, the least loaded at the moment; at the culmination of this process short-term problems arise with access to the resources of this VM.

NET

For ESXi 6.0 virtual servers with 1c server, do not use network interfaces such as WMXNET3, use only type e1000e

RAM

- —Disable memory deduplication for EXSi - Transparent Page Sharing on VMware ESXi host

If you want to disable this mechanism right now, then you need to do the following:

In older versions


After the patch and ESXi updates, the TPS mechanism can be enabled as follows (Advanced Settings in the Software section):

  • Parameter Mem.ShareForceSalting(enabling TPS at the level of the entire ESXi host). If the value is 0, then TPS is still running on the host, if 1 - the mechanism is disabled.
  • Parameter sched.mem.pshare.salt(installed at the VM level) allows you to enable / disable TPS for individual virtual machines (for example, old Windows or Linux - for them you could enable). When the ShareForceSalting parameter is set to 1, then for machines that need TPS in their Advanced Configuration, set the same salt values. Without this, TPS does not work - accordingly, it is disabled.

CPU

- —Turn on the power circuit for maximum performance

- vSphere knows very well about and tries to place virtual cores of machines on those physical processors in whose memory the virtual machine's RAM is now located. But here pitfalls arise. Server manufacturers like to enable NUMA emulation in the BIOS by default. That is, the server appears to the operating system as a NOT NUMA device, and vSphere cannot use its optimization to control this technology. In the vSphere documentation, it is recommended to disable (Disable) this option in the BIOS, this allows vSphere to independently deal with the issue.

DRIVER

- Install VMware Tools Guest Additions

The first thing to do after installing the guest operating system inside the virtual machine is to install the VMware Tools for VMware Guest Additions software package. These packages contain special drivers that make the guest operating system run faster on virtual machine hardware.

Select Install VMware Tools from the virtual machine menu. Follow the instructions on your screen to complete the installation. If you are using a Windows guest OS, you will see that this process is no different from installing other applications.

Checking VMware Tools.

  • Select a host in vClient;
  • Go to the tab Virtual machines;
  • Add a column "VMware Tools Status";
  • Rate the status. OK-> then everything is fine, nothing needs to be done. Not Running / Out of date - we can fix it.

If VMware Tools is not running, you need to deal with the guest operating system. The reason may lie in the update of the Linux kernel or in the disabled (by someone) VMware Tools service in Windows.

If VMware Tools are out of date, you need to update them from the vClient context menu. This usually happens after updates are installed on ESX / ESXi hosts. After that, it is often necessary to update VMware Tools as well.

DISCS

- When using external storage

  • The Independent Persistent Mode of a vmdk disk is the most productive, since changes are made directly to the disk without being journaled. But such a disk is not subject to snapshots, it cannot be rolled back.
  • When using iSCSI, it is recommended to configure jumbo frames (MTA = 9000) on all interfaces and network equipment.
  • MultiPathing - For most cases RoundRobin is OK. Fixed can give great performance, but that's after thoughtful planning and manual tuning of each host to each LUN. MRU can be installed with an active-passive configuration, if some paths disappear from time to time - so that it does not jump back and forth.

How does the rejection of virtualization look like in practice? Virtualization does not always slow down a lot, all the same, the nature of the load, the amount of data are also important.

Stage 1. Step 1. Upload the installation files inside the virtual machine.

We need the following instal files:

1. Platform 1C

Stage 1. Step 2. Launch the installation of the 1C platform

Step 1. Step 3. Connect the components

Step 1. Step 4. Select the interface language

Stage 1. Step 5. Install the 1C platform

Stage 1. Step 6. Install the protection driver

Stage 1. Step 7. We complete the installation of the 1C platform

Stage 2. Open the port for access to the virtual machine from the outside

Stage 2. Step 1. Go to the virtual machines control panel

Step 2. Step 2. Go to the "Endpoints" menu (these are open ports outside)

Step 2. Step 3. Add a new endpoint (port).

We need port 80. Here you can see which ports are already open. One is used to connect via rdp.

Stage 2. Step 4. Don't be smart. Click further

Stage 2. Step 5. Fill in the port parameters. We save.

Step 2. Step 6. Port 80 is created.

Stage 3. Installing the IIS 7.5 web server

Step 3. Step 1. Add a new role

Step 3. Step 2. Next

Stage 3. Step 3. Choose the roles we need. Further

Step 3. Step 4. Next

Step 3. Step 5. Set up roles

Step 3. Step 6. Next

Stage 3. Step 7. Configuring the roles.

Step 3. Step 8. Install IIS

Step 3. Step 9. Close the form

Stage 3. Step 10. Checking the operation of the web server inside the virtual machine

to check it is enough to open a browser and enter http: // localhost in the address bar

As a result, you will see the IIS splash screen

Step 3. Step 11. Checking the web server from outside the virtual machine

The procedure is the same. From any computer we go into the browser and write the address of our virtual machine in the address bar (see part 1). You can specify an external IP address.

By default, the IIS7.5 web server uses port 80. Which we created at the 2nd stage

As a result, you should also see the IIS 7.5 splash screen.

I present my experimental project VM1C. VM1C is a virtual machine that allows you to compile and execute any procedures and functions, as well as entire modules, on the fly.

In fact, this is a full-fledged Reflection feature that is missing in 1C, which is present on other platforms, for example, on .NET and allows you to do truly mind-blowing things there.

For those unfamiliar with Reflection: Wikipedia

Work description

VM1C works without using any external components, using only standard 1C capabilities, does not depend on the platform and configuration. It can be added to the configuration both as processing and as a general module.

VM1C includes:

Let's consider each component separately

VM1C_IL_Compiler- its task is to transform the source code of a module or method into a set of short assembly instructions.

For example the following code

For n = 1 By 100 Cycle n = n + 1; End of Cycle; Refund n;

will be converted to a set of instructions

push 1 stloc 0 push 100 stloc 1 br ~ IL_1 ~ IL_2: ldloc 0 push 1 add stloc 0 ldloc 0 push 1 add stloc 0 ~ IL_1: ldloc 0 ldloc 1 ble ~ IL_2 ~ IL_0: nop ldloc 0 ret

This is done in order to

  1. speed up further processing of the code in real time. Since the compilation process itself takes a relatively long time
  2. provide the ability to create and execute procedures and functions in 1C Enterprise mode

Vm1C_IL_Compiler = Processes._VM1C_IL_Compiler.Create (); Module text = LoadCodeFile ("Modules \ WorkWith Products"); module = vm1C_IL_Compiler. CompileModule (ModuleText);

After we have the intermediate code (hereinafter IL-code), we can execute it in the virtual machine.

Virtual machineVM1Callows, on the fly, by means of a JIT compiler, to compile a module from IL-code back into 1C-understandable code. The compiled code is optimized, stored in the cache, for later reuse, and can be executed.

Vm1C_VM = Process._VM1C_VM.Create (); vm1C_VM.AddModule ("Work with Products", module); parameters = New Array (); parameters.Add ("00000453"); Result = vm1C_VM.CallMethod ("Work with Products", "GetPrice", parameters);

MethodInfo = vm1C_VM.GetCurrentMethodInfo (); parameters = methodInfo ["Parameters"]; ...

get function code

Bytecode = methodInfo ["Bytecode"];

change it, add parameters and call it again in the changed form, etc.

Conclusion

The project is now at the stage of a crude alpha version, so I post only its description and demo video.


The purpose of this publication is to assess the need for this product, to what extent it can be useful to developers, in cases where standard tools are no longer enough to implement the most innovative ideas.

If someone is interested in this development, please be sure to inform!

Demonstration of work

Sincerely,

developer m.bolsun

(c) 2013-2014 VM1C

Update: the publication was in drafts for a long time, because apart from academic interest, there was no immediate practical application for this project. But recently I was able to use its capabilities in practice and it was decided to return the publication. Soon technologies from this project will be used in the new version of Code Inspector.

Thanks to the new full-fledged compiler, the Inspector will receive static analysis and, accordingly, a number of new features:

Checking that the condition is always True or False and that the function returns the same value. Checking not only the last unused values ​​of variables, but also intermediate assignments, taking into account loops and branches. Code analysis in accordance with preprocessor instructions (OnServer, OnClient, etc.). Well, and much more.

Developers of virus software and just developers who do not want their program to be attempted to be reversed, at the launch or installation stage, carry out checks on the virtual machine, and if it is detected, they refuse to work, or even self-destruct. A method is described under the cut on how you can try to solve this problem.

I used VMWare Fusion for Mac, but it works just as well in Workstation for Win.

1) To work, a newly installed system is required, I did not find how to make changes to an existing one.

Prepare a virtual disk, specify the system, as you usually do, and in the settings for the installed machine, I have this item named Isolation, turn off any data exchange with the host OS.

isolation.tools.getPtrLocation.disable = "TRUE"
isolation.tools.setPtrLocation.disable = "TRUE"
isolation.tools.setVersion.disable = "TRUE"
isolation.tools.getVersion.disable = "TRUE"
monitor_control.disable_directexec = "TRUE"
monitor_control.disable_chksimd = "TRUE"
monitor_control.disable_ntreloc = "TRUE"
monitor_control.disable_selfmod = "TRUE"
monitor_control.disable_reloc = "TRUE"
monitor_control.disable_btinout = "TRUE"
monitor_control.disable_btmemspace = "TRUE"
monitor_control.disable_btpriv = "TRUE"
monitor_control.disable_btseg = "TRUE"

These options prevent programs from detecting the virtual environment through such complex checks as tracking memory address space, counters.

Important! If at the stage of setting up the installation there is an option like "Express install", "Express installation" - turn them off. Also, do not install VMWare Tools on the installed system, because some software also includes the presence of this package in the check.

3) Save the file, point to the ISO with the system installer to load, install the OS as usual.

4) Despite the fact that the overwhelming majority of programs that do not like the virtual environment do not go beyond the checks that we cut off in step 2, some especially stubborn ones still go further and try to search, for example, everything that looks like the name of virtual disk controllers.

To defeat them in Windows, go to the registry editor in the HKLM \ SYSTEM \ CurrentControlSet \ Services \ Disk \ Enum branch. As you can see, there is a clear reference to the fact that the disk is virtual.

We need to change it by removing VMware, Virtual, Ven, etc. from the parameter, and save it like that.

It also makes sense to replace everything that changes in the registry with a VMware / Virtual search for some Intel or IBM, and not just disk variables.

Then try running your stubborn object of experiments - in 70 percent of cases, the steps described will help you pass the tests for the virtual environment.

Important! The value in HKLM \ SYSTEM \ CurrentControlSet \ Services \ Disk \ Enum is overwritten after every reboot, so it needs to be changed after every new system start.

Naturally, this is not an exhaustive guide, some software may also try to detect a virtual system using the following methods:

1) Checks the range of MAC addresses (just replaced in the settings of the virtual network adapter before starting the virtual machine)
2) Through WinAPI, by polling the OS configuration and other system information (FirmwareTable)
3) Low-level tricks.
You can check how safe you are against detection, as well as familiarize yourself with other popular tools for detecting sandboxes and virtual machines, using the Pafish tool.

Despite the fact that there are still places where you can give yourself away, the proposed method forces you to outwit most software that does not want to work in a virtual environment, in this case, in VMWare.

As you can see, stealth can also be improved by allocating more system resources to the virtual machine. As for memory, it is worth choosing values ​​that are multiples of 1024.

Thanks to everyone who mastered the article and helped in complementing it with sensible comments!

Normal operation of 1C largely depends on a sufficient amount of RAM. You can check if the allocated memory for the VM is sufficient in the cloud control panel. To do this, you need to enter the VM parameters

And go to the "State of the virtual machine" tab

2. Installing a 4GB fixed-size paging file and placing it on a Super disk.

Attention! For Windows Server 2012 OS it is not possible to transfer the paging file to an additional disk due to the specifics of the operation of virtual machines.

Next, we transfer the swap file to this section. Click on « Win "+R and run the command " sysdm.cpl". In the window that opens, go to the "Advanced" tab and click "Options"

In the new window, in the "Advanced" tab, click "Change"

In the "Virtual memory" window, select the prepared partition, mark "Specify size" and set the paging file size in the field. After that you must press the button "Set"

An OS reboot is required to complete this operation.

3. Setting up the placement of user profiles on a Super disk

When working with 1C terminal users, to increase the speed of work, it is necessary to configure the placement of user profiles on the Super-disk. To do this, you need to change the parameter in the registry and restart the OS.

You will need to change the parameters in the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ ProfileList branch:

ProfilesDirectory - path to the location of user profiles (changing this parameter is sufficient);

Default and Public - change as you wish.

Attention! We recommend that you change this setting before the new user logs in for the first time. Otherwise, the settings for hosting the user profile will need to be changed manually (through the registry in the same branch, you need to find the subfolder with user settings).

4. Clearing 1C caches.

Caching is the process of creating a buffer of frequently used information and, as a rule, static information. Caching is used to speed up the work of the program, in particular, in 1C, configuration files are loaded onto the user's computer so that they do not need to be requested from the server at every request.

However, very often the 1C platform does not correctly handle configuration caching and, as a result, we get inappropriate configuration behavior.

To solve problems and "glitches" of 1C, clearing the cache of the 1C 8.3 platform very often helps. This is done as follows:

  1. The first way to clear the 1C cache

Find the directory where temporary 1C files are stored, they can be seen in the setup menu in the IB list:

We got an address like

C: \ Documents and Settings \ username \ Application Data \ 1C \ 1Cv82 \ tmplts \ 1c

Cache folders are located at

C: \ Documents and Settings \ username \ Application Data \ 1C \ 1Cv82 \

Going there, we find many (the number of folders is equal to the number of configurations) interesting folders:

All selected directories are 1C database cache, you can safely delete them. Before deleting, it is imperative to log out of the IB.

b. The second way to clean temporary files 1C

The second method is simpler, but it is not entirely correct. To clean it, it is enough to delete this configuration and create a new one with the same path to the IB. As a result, the old folder with the cache will be "unlinked" from this IB and a new directory will be created. You can do it this way, the cache is cleared, but temporary files remain on the hard disk.

c. The third way

I recommend using it if the glitches are permanent due to the presence of temporary files. However, this method slows down the performance of the system. Suitable for thin client only. It is necessary to write the command in the additional launch parameters (in the list of bases the Change button, the last tab) / ClearCache... Usage example:

Before carrying out any operations, it is advisable to make a backup copy of the database and load from it!

5. Backing up and restoring the database.

Dumping the database to a file.

Enter the program in the configurator mode. To do this, in the start window of the program, select the required database and click "Configurator":

You will be taken to the database development and administration mode. Then select the "Administration - Unload information base ..." item from the menu:

The program will offer to choose the path where to unload the database file and its name. After selecting the program, inform about the successful completion of the operation:

Restoring a database from a file.
To restore the database from a file, you also need to enter the configurator mode, but select the "Administration - Load information base ..." item:

Select the file that was previously saved (extension .dt). The system will warn you that not saved information will be lost, agree with this.

If everything goes well, 1C will offer to restart the configurator:

6. Utility chdbfl.exe for 1C 8.2 and 8.3

chdbfl.exe is a utility for testing and correcting the 1C 8.3 (8.2) file infobase. The program checks the physical integrity of the database; this is a simplified analogue of testing and fixing in the configurator. for those situations when the system does not start even in the configurator mode. Let's take a look at where the chdbfl.exe utility is located and how to use it.

The utility does not need to be downloaded anywhere, it is located in the folder with the installed program. If you decide to download chdblf.exe from the Internet, it is likely that you will not get a program for fixing information security at all, but harm your computer and company information.
The utility is located in the bin folder of the installed technological platform. For example - C: \ Program Files (x86) \ 1cv8 \ 8.3. *. *** \ bin \ chdbfl.exe, where 8.3. *. *** is the release number of your platform.
The program is very easy to use. After launch, the following window will be displayed:

Where in the form it is necessary to indicate the path to the database file and indicate whether it is necessary to immediately correct the detected errors (if the flag is not set, the utility will only diagnose IB). The path to the database file can be found from the list of available configurations:

After completion, the system informs about the performed actions.

7. Testing and fixing the 1C infobase

The testing and correction mode is called in the 1C 8.3 system configurator by selecting the Administration - Testing and correction menu.

Checks and modes

This window contains a list of necessary checks and modes that will be performed as a result of the utility's operation. Let's consider each of them in more detail:
Reindexing infobase tables - if this flag is set, the tables will be reindexed. Reindex is a complete rebuild of indexes for specified tables. Re-indexing significantly improves the performance of the system as a whole. This procedure will never be superfluous and increases system performance.
Checking the logical integrity of the infobase - the system can check the logical and structural integrity of the database, find errors in the organization of data (for example, pages in a file).
Checking the referential integrity of an infobase - a sub-item of logical checking, checks the information in the database for the presence of "broken" links. "Broken" links appear in the database due to incorrect processing of information by the developer, most often with direct deletion of data or incorrectly configured data exchange. When errors are found, you can choose 3 options: Create objects - the system creates stub elements, which can then be filled in with the necessary information, Clear links - "broken" links will be cleared, Do not change - the system will only show you errors.
Recalculation of totals - in the 1C platform, in the accumulation registers and accounting registers, there is the concept of totals. Totals is a table of calculated results, data from which is faster than analyzing the entire register of information. Generally, recalculating totals increases system performance.
Compression of infobase tables - if installed, this database will be compressed and reduced in size. This is due to the fact that when deleting data from the database, 1C does not physically delete these objects, but only "marks" them for deletion. Those. the user does not see them, but they are :). It is precisely the compression of the database that removes such records permanently. The same effect can be achieved by uploading and downloading a database file (* .dt).
Restructuring infobase tables is the process by which the system re-creates database tables, usually this procedure is called when changes are made to the configuration metadata structure. Restructuring the entire database is a long process, be careful.
If for some reason testing and fixing does not help or you do not have access to the configurator, use the chdbfl.exe utility.

Article ID: 86, Created: June 30, 2016 at 1:05 PM, Modified: May 30, 2018 at 5:27 PM

Top related articles