Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue: playing through adventure service is much heavier on CPU than local #97

Open
ewjmulder opened this issue Oct 18, 2018 · 5 comments

Comments

@ewjmulder
Copy link
Owner

LOCAL FILE SOURCE

idle: 0%
0 scenarios: 10%
1 scenarios: 40%
2 scenarios: 70%
3 scenarios: 70%
4 scenarios: 70%
6 scenarios: 80%

@ewjmulder
Copy link
Owner Author

So local source file playing (triggered over the network with TestNetworkClientSparrenBurcht) first increases linear, but beyond 2 scenario's is quite stable in CPU usage. Probably because increased use of MixerStep algorithm code is the most pressing on CPU, while the other parts (reading, writing) of the scenario actions are quite low in CPU. This is actually a good sign: the main algorithm has a relatively high cost, but scaling up in scenario's is not that expensive.

@ewjmulder
Copy link
Owner Author

URL NETWORK SOURCE - WITH WAIT FOR

idle: 0%
0 scenarios: 10%
1 scenarios: 120%
2 scenarios: 240%
3 scenarios: 340% - But quickly hickups and total stop

URL NETWORK SOURCE - NO WAIT FOR

idle: 0%
0 scenarios: 10%
1 scenarios: 45%
2 scenarios: 70% - But still hickups and total stop!
3 scenarios: 70% - But quickly hickups and total stop

@ewjmulder
Copy link
Owner Author

So WAIT_FOR makes a dramatic difference in CPU usage! That needs to be researched and fixed.
On the other hand, there seems to be a second issue causing hickups and total stop when using multiple network resources in parallel.

@ewjmulder
Copy link
Owner Author

Bottleneck in the Wait for implementation seems to be the Thread.sleep, although from documentation that should not be the case. When replaced with wait() and notifyAll() on ActiveScenario's CPU goes down a lot again. It this a 'bug' in Pine64 + Java + Thread sleep + CPU usage counting? Or is it a 'real thing' in any JVM happening with this code?

@ewjmulder
Copy link
Owner Author

The 'normal step thread' also uses Thread.sleep and that does not cause a high CPU peak. Also a small test running just Thread.sleep in a main does not cause any CPU. So still unclear what is really causing this weird CPU spike. Maybe we are inside some kind of lock or Thread.sleep context is heavy on scheduler / checker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant