crytic / echidna

Ethereum smart contract fuzzer
https://secure-contracts.com/program-analysis/echidna/index.html
GNU Affero General Public License v3.0
2.74k stars 368 forks source link

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

Open 0xicingdeath opened 7 months ago

0xicingdeath commented 7 months ago

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

ggrieco-tob commented 7 months ago

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

0xicingdeath commented 7 months ago

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

aviggiano commented 6 months ago

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

elopez commented 6 months ago

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

aviggiano commented 6 months ago

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

ggrieco-tob commented 5 months ago

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

aviggiano commented 5 months ago

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.

ggrieco-tob commented 5 months ago

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.

aviggiano commented 5 months ago

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.

ggrieco-tob commented 5 months ago

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).

aviggiano commented 5 months ago

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

pgoodman commented 4 months ago

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

ggrieco-tob commented 3 months ago

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

aviggiano commented 3 months ago

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