Using external Load Balancer

Application Load Balancing (Layer 7)

This page provides information about recommended ways to use sessions with a Layer 7 load-balancer.

Most load-balancers have the ability to provide cookies for pinning subsequent traffic from a client to the appropriate server. This method is called sticky session, session persistence or session affinity. Using cookies efficiently requires the client to know when a cookie should be sent, should not be sent or should be deleted.

Sticky session load balancing

Each MetaDefender Core instance has its own databases and application sessions that cannot be seen by other instances. Therefore, in order to get the related data/response to our queries we should ask the appropriate MetaDefender Core v5 server. On the other hand, to keep the advantages of the used load balancing method, cookies should not be sent if it is not necessary.

Single file scanning

StepStageTaskCookie usage
1.Sending fileInitiate processing a file on the client side. Send file through the load-balancer. (See POST File AnalysisAPI)Cookie should not be sent
2.Sending fileSave the cookie and the data_id you got from the load-balancerSave cookie
3.Getting resultRequest result related to data_id saved in step 2. (See GET File AnalysisAPI)Send cookie saved in step 2
4.Getting resultIf processing is in progress (See GET File AnalysisAPI), wait a little while and repeat step 3.Send cookie saved in step 2

Batch scanning

StepStageTaskCookie usage
1.Open batchInitiate processing file(s) in batch. Request a batch ID through the load-balancer. (See POST Initiate BatchAPI)Cookie should not be sent
2.Open batchSave the cookie and the batch_id you got from a Core server through the load-balancer.Save cookie
3.Sending filesSend file through the load-balancer. (See POST File Analysis (using batch header)API)Send cookie saved in step 2
4.Sending filesSave the data_id you got from the load-balancer.-
Sending filesStatus/result of scanning of sent files can be queried: (See GET File AnalysisAPI)Send cookie saved in step 2
5.Sending filesRepeat step 3-4. with files wanted to be in the same batch.-
6.Getting batch statusSee GET Batch StatusAPISend cookie saved in step 2
7.Close batchTell the server that no more files will be sent to this batch. (See POST Close BatchAPI). (This will only be successful if all the files sent to the batch have been processed already. Repeat this step until batch is closed.)Send cookie saved in step 2
8.Getting resultsRequest results related to batch ID saved in step 2. (See GET Download Batch Signed ResultAPISend cookie saved in step 2

If it does not matter which upstream server responds, the queries should be sent without cookie.

It is recommended not to send cookies when it's not necessary to allow load-balancer to use its own method to share the load between MetaDefender Core v5 servers.

Limitations, additional notes

Using load-balancing between MetaDefender Core servers does not support:

  • Global scan history
  • Core server administration through load-balancer

OPSWAT products that support HTTP load balanced MetaDefender Cores

Product nameMinimum versionFurther information
MetaDefender Kiosk4.3.4-
OPSWAT ClientWindows: 7.6.247.0 Mac: 10.4.243.0-
MetaDefender Email Security4.3.0-
MetaDefender ICAP Server4.3.0-
MetaDefender Vault1.3.0-
MetaDefender for Secure Storage2.0.7-

DNS Load Balancing

Using this method is logically similar to Layer 7 load-balancing.

Briefly how it works

Client uses a domain name to send a query to a server. Client's DNS server has more "A" records for that name with different IPs. When a client resolves the server's domain name DNS server randomly chooses an IP for that name to send back. When a session is used on the application layer, client should know the IP address of the Core server that handles that specific session. In every other case, client should resolve the domain name with DNS query to let requests to be balanced between MetaDefender Core servers.

Single file scanning

StepStageTaskAddressing
1.Choose a Core server by using DNS load balancingResolve the Core servers' common domain name.Use domain name
2.Choose a Core server by using DNS load balancingSave the IP gotten from the DNS server.Save the IP
3.Sending fileInitiate processing a file on the client side. (See POST File AnalysisAPI)Use IP saved in step 2
4.Sending fileSave the data_id got from the Core server-
5.Getting resultRequest result related to data_id saved in step 2. (See GET File AnalysisAPI)Use IP saved in step 2
6.Getting resultIf processing is in progress (See GET File AnalysisAPI), wait a little while and repeat step 3.Use IP saved in step 2

Batch scanning

StepStageTaskAddressing
1.Choose a Core server by using DNS load balancingResolve the Core servers' common domain name.Use domain name
2.Choose a Core server by using DNS load balancingSave the IP gotten from the DNS server.Save the IP
3.Open batchInitiate processing file(s) in batch. Request a batch ID. (See POST Initiate BatchAPI)Use IP saved in step 2
4.Sending filesSend file to the specific Core server with the basch ID saved in step 3. (See POST File Analysis (using batch header)API)Use IP saved in step 2
5.Sending filesSave the data_id you got from the Core server.-
6.Sending filesStatus/result of scanning of sent files can be queried: (See GET File AnalysisAPI)Use IP saved in step 2
7.Sending filesRepeat step 3-4. with files wanted to be in the same batch.-
8.Getting batch statusSee GET Batch StatusAPIUse IP saved in step 2
9.Close batchTell the server that no more files will be sent to this batch. (See POST Close BatchAPI). (This will only be successful if all the files sent to the batch have been processed already. Repeat this step until batch is closed.)Use IP saved in step 2
10.Getting resultsRequest results related to batch ID saved in step 2. (See GET Download Batch Signed ResultAPI).Use IP saved in step 2

Limitations, additional notes

Using load-balancing between MetaDefender Core servers does not support:

  • Global scan history
  • Core server administration via DNS load-balancing

OPSWAT products that support DNS load balanced MetaDefender Cores

Product nameMinimum versionFurther information
MetaDefender Kioskdoes not support yet-
MetaDefender Clientdoes not support yet-
MetaDefender Email Securitydoes not support yet-
MetaDefender ICAP Serverdoes not support yet-
MetaDefender Vaultdoes not support yet-
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard