How to define program's requirements
Asked Answered
G

1

7

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.

Grudge answered 25/7, 2016 at 11:57 Comment(2)
Is it one JVM that is running several tasks, or several different JVMs ? Are they running non stop, or are they triggerred by the OS (cron for example) and stop running when finished ?Kaz
In this specific case I have program with serveral task on singe JVM, and it should work permanently, but in fact i'm looking for some general solution, even not only for Java programs.Grudge
M
4

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.

Mackinnon answered 25/7, 2016 at 13:3 Comment(3)
I'm looking rather for some general solution. There are some methods to define how many processor's computing power and memory is used by program. So, there should be some method to define minimal (or recomended) hardware specification based on them and i'm looking for some example. It even does not have to be based on Java.Grudge
Many programs will use more resources if they are available, but can also get along with less. Also, the required resources can depend a lot on the load - quite often it scales somehow (usually non-linear) with the size and frequency of input or some other quality of input data.Mackinnon
Basically, you can only test and measure - you cannot easily predict performance on different hardware.Mackinnon

© 2022 - 2024 — McMap. All rights reserved.