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

[Feature Request] Resource Limit #6

Closed
svenger87 opened this issue Feb 8, 2018 · 12 comments
Closed

[Feature Request] Resource Limit #6

svenger87 opened this issue Feb 8, 2018 · 12 comments
Labels

Comments

@svenger87
Copy link

An option in config.ini to limit CPU use would be nice.
When i run 2 threads on my Windows machine the OS freezes constantly.

@laubblaeser
Copy link

How many cores does your Windows machine have?

@svenger87
Copy link
Author

4 cores 4 threads

@vuapo-eth
Copy link
Owner

vuapo-eth commented Feb 8, 2018

right now all spam threads are using maximum priority, we will add an option to change that in the next release, thank you for the request!

@laubblaeser
Copy link

I experience similar problems on my Windows machine, using 4 out of 6 cores. A reduction of thread usage would be nice.

@laubblaeser
Copy link

Just did some 30 minutes of testing. Using 4 out of 6 cores I can spam about 13.5 txs/min. Using only 1 core I can still spam ~12 txs/min. Using only one core does not slow down the pc at all, everything above that causes a slowdown. I suggest everyone only uses one core for spamming until this issue is resolved because the difference is negligible.

@vuapo-eth
Copy link
Owner

v1.0.3 now supports configurating the thread priority (minimum/normal/maximum priority)

@gjeee
Copy link

gjeee commented Feb 9, 2018

somehow if i configure 1 thread with minimum priority, this jar still consumes >95% CPU most of the time. i do not understand why. my machine has 2 cores/4 processors. so 1.0.3 does not solve it for me....

@vuapo-eth
Copy link
Owner

that's interesting. i suspect that the iota.lib.java library has its own thread management. we are going to do some research on that.

@gjeee
Copy link

gjeee commented Feb 9, 2018

You are most definitely right: the doc of the iota.lib.java library says:

Threading

It should be noted that most API calls are done synchronously. What this means is that you have to call the API from a background or worker thread, not from the main or UI thread!

@gjeee
Copy link

gjeee commented Feb 10, 2018

I checked your code. I think i found the exact cause: your NodeManager class interacts with the IOTA API. So this should run on a separate thread (as suggested in its doc). However in the main thread you create a NodeManager instance which is passed in the constructor of the first SpamThread you launch. Thus although you launch separate threads, the first SpamThread sends its spam with a NodeManager which was created on the main thread. So this explains the freezing.

@vuapo-eth
Copy link
Owner

@gjeee The SpamThread instances are seperate threads calling methods in the NodeManager class - it doesn't matter in which Thread the NodeManager object was created, but rather from which one its methods are called.

@vuapo-eth
Copy link
Owner

Fixed in v1.0.4

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

No branches or pull requests

4 participants