I am running a Finatra server (https://github.com/capotej/finatra) which a sinatra inspired web framework for scala built on top of Finagle (an asynchronous RPC system). The application should be design to receive something between 10 and 50 requests concurrently. Each request is quite CPU intensive, mostly due to parsing and serializing large JSON's and operation on arrays, like sorting, grouping, etc...
Now I am wondering what is the impact of the following parameters on performance and how to combine them :
- RAM of the server
- Number of cores of the server
- JVM heap size
- Number of threads run on parallel in my Future Pool
As a partial response, I would say :
- JVM heapsize should me tuned depending on RAM
- Having multiple cores improves performance under concurrent workload but does not really speed up processing of a single request.
- Having large RAM, on the contrary, can notably speed up execution of a single request
- Number of threads in my Future Pool must be tuned according to my number of cores.
EDIT
I want to compare performance regardless of the the code, only focusing on hardware/threading model. Let's assume the code is already optimized. Additional information :
- I am building a data reporting API. Processing time of a request largely depends of the dataset I am manipulating. For big datasets, it can hit 10 seconds max.
- I retrieve most of the data from third party API but I am also accessing a MySQL database with a c3po connection pooling mechanism. Execution of the request is additionally delegated to a Future Pool to prevent blocking.
- No disk IO excluding MySQL
- I don't want to cache anything on the server side because I need to work with fresh data.
Thanks !!!