What i have
- incoming single http request with ~10mb of data (i get hundreds of them in seconds)
- couple of servers.
loadBalancer
,server-1
,server-2
, ...availableServer
What i am currently doing
1- loadBalancer
gets request. Downloads data. Choose server. Send request to availableServer
2- Processed data send back to loadBalancer
4- Load balancer send the result to user.
Problem
loadBalancer
is downloading, uploading and handling big data as extra. Which slow downs the response time for user.
What i want
1 - Http/https request will come to my loadBalancer
server
2 - loadBalancer
choose destination server and redirect the request without downloading big data in request body.
3 - Main server will process the data and return the result to the user.
My Question
How to redirect the request without downloading data in body? Or what technique should i use to overwhelm this situation. I just want loadBalancer
to do a gentle touch to request to adjust it in the right direction.
Possible but unwanted solution
User can simply call
var bestServerUrl = get('loadBalancer/getAvailableServerUrl')
var result = post('bestserverUrl/processData',bigData)
But this way is unwanted. Becomes more complex for user. User might only use one server url. etc... It should be handled by me.