Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define program's requirements

Is there any easy, cheap (which don't require to test program on many hardware configuration) and painless method to define hardware requirements (like CPU, RAM memory etc), that are require to run my own program? How it's should be done?

I have quite resource-hungry program written in Java and i don't know how to define hardware specification that will be enough to run this aplication smoothly.

like image 799
Marcon Avatar asked Jul 25 '16 11:07

Marcon


1 Answers

No, I don't think there is any generally applicable way to determine the minimum requirements that does not involve testing on some specified reference hardware.

You may be able to find some of the limitations by using Virtual Machines of some kind - it is easier to modify the parameters of some VM than modifying hardware. But there are artifacts generated by the interaction between host and VM that may influence your results.

It is also difficult to define the criteria for "acceptable performance" in general without knowing a lot about use cases.

Many programs will use more resources if they are available, but can also get along with less.

For example, consider a program using a thread pool with a size a based on the number of CPU cores. When running on a CPU with more cores, more work can be done in parallel, but at the same time overhead due to thread creation, synchronisation and aggregation of results increases. The effects are non-linear in the number of CPUs and depend a lot on the actual program and data. Similarly, the effects of decreasing available memory range from potentially throwing OutOfMemory-Errors for some inputs (but possibly not for others) to just running GC a bit more frequently (and the effects of that depend on the GC strategy, ranging from noticeable freezes to just a bit more CPU load).

All that is without even considering that programs don't usually live in isolation - they run on an operating system in parallel with other tasks that also consume resources.

like image 154
Hulk Avatar answered Oct 04 '22 06:10

Hulk