For example: you can see the --max-threads
option (Default: 200) in the deploy command page for tools of SAP Cloud Platform. Assume there is need 0.2 seconds to process a request, so the
max processed requests per-second is
\[ L = \lambda \cdot W \]
\[ \lambda = \frac{L}{W} \]
\[ \lambda = \frac{200}{0.2} = 1000 \]
So our application maximum process requests per-second is 1000. This is only theoretical value, the increased parallelized threads will eat more cpu resources then process per request need more times.
According to Amdahl’s law the theoretical speedup in latency of the execution of a task at fixed workload that can be expected of a system whose resources are improved.
Amdahl’s Law specifies the maximum increase in speed that can be achieved by adding additional threads:
\[ S(n) = \frac{T(1)}{T(N)} = \frac{1}{\alpha + \frac{1 - \alpha}{N}} = \frac{N}{1 + \alpha(N - 1)} \]
- N is the number of available threads
- α is the fraction of the program that is serialized
- T(N) is the time the algorithm needs when executed with N threads
The increase in speed of a program using multiple processors in parallel computing is limited by the sequential fraction of the program. For example, if 95% of the program can be parallelized, the theoretical maximum speedup using parallel computing will be 20 times, no matter how many processors are used:
So we can’t scale up our server to speedup processing request blindly, but we need refactor our application architecture and scale out our server.
Comments