5 Replies Latest reply: Jan 31, 2011 2:02 PM by Todd Little-Oracle RSS

    service called in loadbalance way

    652398
      Case:
      Server A and B results in load balance.
      Service A both in server A and B.
      Service B both in server A and B.
      Service A will call Service

      Case:
      One master: 192.172.1.1
      Two slaves: 192.172.2.1/192.172.2.2
      There is service A deployed in slave1(192.172.2.1) and slave2(192.172.2.2). Service A will call Service B, which is also deployed in slave1 and slave2.

      Condition:
      If I tmshutdown -s service_A in slave1, there is a service_A alive only in slave2.
      My experiment proves that when there is requests to service A in slave2, service_B in slave1 will be called by service_A in slave2. In my mind, service_B in slave1 should be called by service_A only in slave1, is that right?

      Question:
      If so, is there any ubb config option which will let service_B in slave1 will not be called by service_A in slave2?
      As for service_B in slave1 is called by service_A in slave2, it is configured in dmconfig or ubbconfig? Which option?

      Thanks for your kindly reply.
        • 1. Re: service called in loadbalance way
          Todd Little-Oracle
          Hi Bill,

          I'm having a little trouble following your scenario, but in general if a service is advertised by any server in an MP domain, any client (or server acting as a client) will be able to call the service. If you want most requests for the service to stay local and not go to a remote copy of the server offering the service, you can set the NETLOAD parameter extremely high. But if the service is available only on the remote machine, all local clients/servers will use the remote server.

          I hope that made sense. If not, let me know. Also, if you could explain what it is you trying to do and why, I might be able to come up with an alternative solution.

          Regards,
          Todd Little
          Oracle Tuxedo Chief Architect
          • 2. Re: service called in loadbalance way
            652398
            In server, there are a lot of different services running at the same time. One service is the same as just as mentioned above, that is Service B is called by Service A. When Service A is tmshutdowned in server A, Service A will also be called by Service A in server B.

            As you said, if I set the NETLOAD parameter extremely high, other service in the same server will be impacted which is not what I want to do. So pls advice me.

            By the way, as you said, the way to set the NETLOAD parameter extremely high is that I set the NETLOAD parameter extremely high both in two servers, then all services will be called only in respective local server. Is that right?

            Thanks Todd.
            • 3. Re: service called in loadbalance way
              Todd Little-Oracle
              Hi Bill,

              Let me see if I can restate the scenario as I'm having a hard time following it. You have a 3 node MP domain, let's call the machines master, slave1, and slave2. You also have two servers (oddly enough called service_A and service_B) which each advertise (offer) ServiceA and ServiceB. ServiceA as part of its execution calls ServiceB. Do I have the scenario described correctly so far? I'm guessing from the names of the servers that I don't really have this described correctly. My guess is that server service_A only advertises ServiceA, and server service_B only advertises ServiceB, but that is purely a guess based upon the server names.

              To continue, you have a single copy of the servers service_A and service_B running on slave1 and slave2. You shutdown the copy of service_A on slave1. ServiceA is now only offered by server service_A on slave2, but ServiceB is still offered by both copies of service_B, one running on slave1 and one running on slave2. When ServiceA is called, it executes in service_A on slave2 and then calls ServiceB. You see that ServiceB is handled by service_B on slave1, which is remote to service_A.

              First of all, you need to understand how Tuxedo currently does load balancing in an MP configuration. On all machines in an MP configuration, a copy of the Bulletin Board exists that lists all clients, servers, services, and IPC queues. When making a routing decision, Tuxedo scans the list of IPC queues available to handle the service and if it finds one empty (idle), it immediately places the request on that queue. Otherwise, Tuxedo looks for the queue with the least amount of work queued to it and then places the request on that queue. If the queue is remote, i.e., on another node in the domain, Tuxedo adds NETLOAD to the amount of work that would be queued and uses that to determine whether or not the request should be placed on the remote queue. One thing to keep in mind is that Tuxedo doesn't currently track the actual work queued on remote queues. So the work queued to remote queues, is only the work queued by the local node. This value is reset periodically as the local node doesn't know the real-time value of the remote queue's work queued.

              It sounds like you are trying to allow some services to be called remotely, yet others you don't want to be called remotely. The only way to have any control over this is to carefully specify the LOAD parameter for each SERVICE and the value of NETLOAD.

              Might I ask why you need this behavior?

              Regards,
              Todd Little
              Oracle Tuxedo Chief Architect
              • 4. Re: service called in loadbalance way
                652398
                “It sounds like you are trying to allow some services to be called remotely, yet others you don't want to be called remotely. The only way to have any control over this is to carefully specify the LOAD parameter for each SERVICE and the value of NETLOAD.

                Might I ask why you need this behavior?”

                Your guess is right. For reasons, Service B is a service which cannot stop normally. Therefore, when we want to update Service B in code, we should stop Service B both in server A and server B and update it one by one. While other services both in two servers is not impacted. That's why we want to allow some services to be called only remotely, yet others don't.

                As you said, the only way is to set LOAD parameter and NETLOAD parameter. Could you briefly introduce how the LOAD and NETLOAD parameter have effects on that? Or some reference I can find some directions or answer?

                Thanks a lot.

                BTW, tomorrow I will on my vacation for one weeks, so maybe my reply will be slow. Sorry for that, and I will response it ASAP.
                • 5. Re: service called in loadbalance way
                  Todd Little-Oracle
                  Hi Bill,

                  Using NETLOAD, LOAD, or other load balancing parameters to achieve what you are trying to do is probably not the best idea. My suggestion would be to consider dynamic service advertisements. Using tpadvertise() and tpunadvertise(), you can control when a server is available to accept requests for one or more services. Generally this is done via some control service that you can call.

                  To allow calling the service in a specific server, often what will be done is to re-advertise the service, but with a server specific name. So let's say you build the server with a CONTROL service that allows you to control when or if services are advertised, you would then tpadvertise() the same function entry point with the service name CONTROL_{MACHINE}_{PID} where {MACHINE} is the Tuxedo LMID for the machine and {PID} is the OS process ID. Alternatively you could use CONTROL_{GRP}_{SRVID} where GRP is the Tuxedo server group the server is in, and {SRVID} is the Tuxedo server ID. Either way will give you uniquely named services you can invoke to interact with a specific server for control purposes.

                  Does this make any sense to you?

                  Regards,
                  Todd Little
                  Oracle Tuxedo Chief Architect