title: Heavy class as a Service
body: <p>I have a class that performs some very heavy computation and requires a lot ammounts of RAM. Basically, the problem is RAM since it does require around 5GB of RAM. I have two computers available. 
  My idea is the following:</p>
  
  <ol>
  <li>Create a service on the powerful machine that will have the heavy
  class loaded. </li>
  <li>Create a client on the less powerful laptop that will
  send requests to the Class Service and gather the required results.</li>
  </ol>
  
  <p>Now that I have implemented this I face the following problem:
  Since thousands of HTTP requests are generated per second there is very heavy overhead due to connection open/close. Thus, the performance is still bad.</p>
  
  <p>Is there any more clever way to face the above issue?
  Would the idea of using a simple socket be useful?
  One idea that I have for now is to perform request caching (e.g. Gather 10000 requests and send only one to the class service. The response will contain data for all the 10000 requests).</p>