!--a11y-->
Configuring the Number of Registered RFC
ServersIn the standard configuration, only one RFC server registers itself with the SAP Gateway. If parallel search requests are frequently sent to TREX, you should increase the number of registered RFC servers. The requests are then distributed among several RFC servers and can be processed more quickly.
Technical background information: The RFC server processes requests one after another. If it is currently processing a request and then receives further requests, it collects them in a queue. If the RFC server receives too many requests, the queue may become full. This means that no more requests are accepted.

SAP recommends that you start twice as many RFC servers as the host has CPUs.
The possible number of RFC servers is not directly linked to the number of CPUs. However, if too many RFC servers are running, the CPU uses more time to swap between the processes than to process the requests.
The following procedure describes how you increase the number of registered RFC servers.
...
1. Edit the configuration file <TREX_DIR>/<host_name>/TREXDaemon.ini.
2. Change the parameter instances in the RFC server section:
[rfcserver]
Windows: executable=TREXRfcServer.exe
UNIX: executable= TREXRfcServer.x
arguments=-r
startdir=<TREX_DIR>/exe
instances=<number_of_RFC_servers>

If your host has 4 CPUs, set the number of RFC servers to 8.
3. If you are using the SAP Gateway of the application server, an RFC server needs to be registered for every application server used. Because each application server has its own gateway, the configuration file must contain one RFC server section for each application server. Add RFC server selections as required:
[rfcserver<number>]
Windows: executable=TREXRfcServer.exe
UNIX: executable=TREXRfcServer.x
arguments=-r
–host=<gateway_host> -instance=<gateway_instance>
–service=<registration_name>
startdir=<TREX_DIR>/exe
instances=<number_of_RFC_servers>
The registration name should have the following structure:
TREXRfcServer_<instance_number>_<trexhost>
Enhance the section names in the parameter programs:
[daemon]
programs=queueserver,indexserver,preprocessor,nameserver,rfcserver,rfcserver<number>, rfcserver<number> ...

You want to register RFC servers for two application servers. To do so, change the configuration file as follows:
[rfcserver1]
Windows: executable=TREXRfcServer.exe
UNIX: executable=TREXRfcServer.x
arguments=-r
–host=mygatewayhost1 ‑instance=sapgw47
–service=TREXRfcServer_48_mytrexhost
Windows: startdir=C:\usr\sap\<SAPSID>\TRX48\exe
UNIX: startdir=/usr/sap/<sapsid>/trx48/exe
instances=4
[rfcserver2]
Windows: executable=TREXRfcServer.exe
UNIX: executable=TREXRfcServer.x
arguments=-r
–host=mygatewayhost2 -instance=sapgw29
–service=TREXRfcServer_48_mytrexhost
Windows: startdir=C:\usr\sap\<SAPSID>\TRX48\exe
UNIX: startdir=/usr/sap/<sapsid>/trx48/exe
instances=4
[daemon]
programs=queueserver,indexserver,preprocessor,nameserver,rfcserver,rfcserver1,rfcserver2
Changes to the configuration file take effect when you next start the TREX daemon.