echidna icon indicating copy to clipboard operation
echidna copied to clipboard

[Bug-Candidate]: Maximize CPU output when running fuzzer

Open 0xicingdeath opened this issue 1 year ago • 14 comments

Describe the issue:

When deployed on a 16 core machine, with 15 workers, the CPU usage seems to be maxed at about 40-50%. When deployed on an 8 core machine, with 7 workers, CPU usage has only ever hit a max of around 65%.

Code example to reproduce the issue:

Follow instructions for reproduction here, and if testing on cloudexec, then run make ec (for echidna-cloud) or make el (echidna-local).

https://github.com/curvance/Curvance-CantinaCompetition/tree/CodeFAQAndAdjustments/tests/fuzzing

Version:

Echidna 2.23 & previous

Relevant log output:

No response

0xicingdeath avatar Mar 12 '24 15:03 0xicingdeath

Can you check if this a regression from a previous version? I think @elopez reproduced this with the current version as well.

gustavo-grieco avatar Mar 12 '24 15:03 gustavo-grieco

This applies to previous builds as well – or at least the branches for fixes on Curvance between 2.2.2 and 2.2.3.

0xicingdeath avatar Mar 12 '24 16:03 0xicingdeath

When deployed on a 32-core machine, with 32 workers, the CPU usage does not surpass 10%

Screenshot 2024-05-06 at 19 04 43

aviggiano avatar May 06 '24 22:05 aviggiano

@aviggiano hi! what version are you testing with? Can you check if there is any improvement with a build from PRs #1243 or #1245?

elopez avatar May 06 '24 23:05 elopez

hi @elopez I'm using 2.2.3 I'll test with those PRs to see if there's an improvement

aviggiano avatar May 07 '24 12:05 aviggiano

@aviggiano any updates? You can also re-test with the latest master since we merged additional fixes for this

gustavo-grieco avatar May 15 '24 09:05 gustavo-grieco

Hey Sorry, I didn't test it because I'd need to merge the 2 PRs locally. Now that's on master it's easier for me to test this. I'll do this today.

aviggiano avatar May 15 '24 09:05 aviggiano

Actually https://github.com/crytic/echidna/pull/1245 is not merged yet, but I think we can quickly rebase it on top of master (@elopez) so you can get a binary, otherwise, testing with master perhaps it is enough to see some improvement.

gustavo-grieco avatar May 15 '24 11:05 gustavo-grieco

Thanks, Just to rectify, I'll get back with data, not today, but soon because I need to spin a big instance on AWS and I'll only get back to that fuzzing task next week.

aviggiano avatar May 15 '24 13:05 aviggiano

Personally, I'm getting better result on testing master on a Ubuntu server. With 14 workers, I'm getting a utilization close to 1100% (so around 11 cores).

gustavo-grieco avatar May 15 '24 13:05 gustavo-grieco

Hey

Much better than before! But still not 100% 🤔

Screenshot 2024-05-20 at 19 35 21

I'm using this build https://github.com/crytic/echidna/actions/runs/9095717896/job/24999535164?pr=1245

aviggiano avatar May 20 '24 22:05 aviggiano

Can you make num workers 2 times the number of cores? :-P

pgoodman avatar Jun 14 '24 19:06 pgoodman

@aviggiano can you try again using master? We merged the GHC 9.6 support, so perhaps that will help.

gustavo-grieco avatar Aug 02 '24 15:08 gustavo-grieco

Hey @ggrieco-tob sorry but I'm OOO for the month, I won't be able to test this for some time

aviggiano avatar Aug 03 '24 12:08 aviggiano