NOTE: This page has been translated automatically from Russian to English. Original page.
Automatic restart Server Agent service 1C Enterprise 8.
It is known that there is the following problem in the functioning of workflows 1C Enterprise 8.1 rphost.exe server: due to the nature of the platform, connecting every new customer to the working process, increases the size of the occupied memory workflow. In this case, when the client is disconnected, the volume occupied by the connecting is not released. The same amount of memory occupied by the worker process can be increased when the program code. This behavior is called "memory leaks" or "Memory Leaks". As a result, when the amount of memory a process grows longer rphost.exe operedelennogo limit (in my case it was> 1Gb), workflow definitely restarted. It is clear that clients connected to this process, receive a message that the connection to the server is broken, stop working and have to reconnect. Depending on the number of users and the number of running work processes, this problem occurs with some frequency. In my case - about 60 members and one workflow, a similar situation occurred up to 5 times a week. Those. about any stable system 1C in this case we are not talking.
The first step in solving the problem was - to increase the number of work processes, and that was done. However, the problem is only partially solved by restarting work processes began to occur less frequently, but not disappeared completely.
Second, and quite logical step - automatic restart processes on a server, which is, in fact, I want to write.
Because the service of 1C Enterprise Server Agent is a standard service in the arsenal of Windows there is a standard way to stop and start the services from the command line net stop and net start. Suffice it to only those commands to include in a bat-file and configure the scheduler to run scheduled bat-file, I set up a restart once a day, at night. It should be borne in mind that if you restart worker processes in the workplace, all connected to a server 1C Enterprise customers will be turned off!
Moreover, in order to spread a little time and a stop command to start the service, we will use the well-known utility sleep.exe, which is easy to find on the web.
Example text restart1c.bat bat-file:
rem @echo off
rem \\ ----- beginning of the script to stop and start the server agent 1C ---- \\
set logfile = "stopstartlog.txt"
set timeout = 20
echo% date%% time% >>% logfile%
net stop "1C: Enterprise 8.1 Server Agent" >>% logfile%
c: \ scripts \ sleep% timeout%
echo% date%% time% >>% logfile%
net start "1C: Enterprise 8.1 Server Agent" >>% logfile%
c: \ scripts \ sleep% timeout%
rem \\ ----- end of the script to stop and start the server agent 1C ---- \\
Explanation of used variables and commands:
* Logfile - stopstartlog.txt file, which records the results of teams, located in the same directory as the bat-file itself;
** Timeout - time in seconds;
*** C: \ scripts - directory where you want to place the program sleep.exe, bat-file and a log file;
From the same bat-file can be immediately after the restart process to run the backup script by 1C Company. In this case, you are guaranteed not to be connected to any client.
Necessary note: the user under which the task will be carried out to restart the service must have the appropriate rights to stop and start the server services.
Sources:
- Materials forum www.mista.ru;
- Documentation on 1C Enterprise 8.1;
- Documentation on the MS Windows product;