kaistshadow / blockchain-sim

Scalable blockchain simulator/emulator running on shadow simulator
MIT License
9 stars 1 forks source link

공인인증 브렌치 #345

Closed tkdlqm2 closed 3 years ago

tkdlqm2 commented 3 years ago

1차 공인 인증 goal

  1. 애뮬레이션 시 메모리 중복 제거
    • memory dedup 기능을 사용했을 경우와 아닌 경우의 메모리 사용량을 linux ps 툴을 사용하여 실제 물리메모리 사용량 비교.
    • 비교 기준 : 메모리 중복 제거율 80% 이상인 경우 성공.
    • 시뮬레이션 조건 시뮬레이션 시간 : Non-dedup (1000Sec / 2000Sec) / dedup (1000Sec/2000Sec) 합의 알고리즘 : POW 노드 수 : 100개 (로컬 pc 환경)
tkdlqm2 commented 3 years ago

Input console

python ps_script.py

output console

Emulation start...
Start dedup mode 1000Sec simulation ... 
Successfully dedup mode 1000Sec simulation ...
Start non-dedup mode 1000Sec simulation ... 
Successfully non-dedup mode 1000Sec simulation ...
Start dedup mode 2000Sec simulation ... 
Successfully dedup mode 1000Sec simulation ...
Start non-dedup mode 2000Sec simulation ... 
Successfully non-dedup mode 1000Sec simulation ...

The memory deduplication rate is --->  71.54 Percentage 

적량적 목표치는 80% 이상인데, 결과는 그렇지 않아서 실험 셋팅을 바꾸면서 진행할 예정.

tkdlqm2 commented 3 years ago

image

시뮬레이션 시간 셋팅은 1000S/2000S 그대로 셋팅하였고, 변경한 부분은 SimpleTransaction class의 dummy_text크기를 늘려줌

        // Before 
        // char dummy_text[200];

        // After
        char dummy_text[400];
tkdlqm2 commented 3 years ago

image Blockchain metric에서 공인인증 기준은 다음과 같이 Latency같은 경우 Max, Min, average 값 TPS같은 경우 Max, Min, Average, Tx cnt를 print해주는 것으로 할 예정임. (print 되는 값의 기준은 없음)

tkdlqm2 commented 3 years ago

How to reproduce

[Linux system setting for memory deduplication]

  1. edit /etc/security/limits.conf, add two lines:
    <username> soft nofile 10485760
    <username> hard nofile 10485760
  2. edit /etc/systemd/user.conf
    change "#DefaultLimitNOFILE=" to "DefaultLimitNOFILE=10485760"
  3. edit /etc/systemd/system.conf
    change "#DefaultLimitNOFILE=" to "DefaultLimitNOFILE=10485760"
  4. edit /etc/sysctl.conf, add three lines:
    fs.file-max = 10485760
    fs.nr_open = 10485760
    vm.max_map_count = 1073741824
  5. reboot

[simluatte - memory deduplication]

python setup.py --bitcoin; python setup.py --test
cd cert/memory
python ps_script.py

[TPS]

python setup.py --bitcoin; python setup.py --test
cd cert/perf/TPS
python cert_tps.py

[Latency]

python setup.py --bitcoin; python setup.py --test
cd cert/perf/Latency
python cert_latency.py
tkdlqm2 commented 3 years ago

테스트 서버 IP 및 계정은 문의하시면 알려드리겠습니다.

tkdlqm2 commented 3 years ago

[Input]

git checkout issue/345/publictest
python setup.py --bitcoin
python setup.py --test
cd cert/p2p
python cert_p2p.py

[output]

Start p2p 10nodes emulation ...
Successfully 10nodes emulation ...
Gossip simulation result : Success 
NodeDiscovery simulation result : Success
-------------------------------------------------------------------------------------
Start p2p 1000nodes emulation ...
Successfully 1000nodes emulation ...
Gossip simulation result : Success 
NodeDiscovery simulation result : Success
tkdlqm2 commented 3 years ago

테스트 서버 IP 및 계정은 문의하시면 알려드리겠습니다.

How to reproduce

[Linux system setting for memory deduplication]

  1. edit /etc/security/limits.conf, add two lines:

    <username> soft nofile 10485760
    <username> hard nofile 10485760
  2. edit /etc/systemd/user.conf

    change "#DefaultLimitNOFILE=" to "DefaultLimitNOFILE=10485760"
  3. edit /etc/systemd/system.conf

    change "#DefaultLimitNOFILE=" to "DefaultLimitNOFILE=10485760"
  4. edit /etc/sysctl.conf, add three lines:

    fs.file-max = 10485760
    fs.nr_open = 10485760
    vm.max_map_count = 1073741824
  5. reboot

  6. build & compile

    git checkout issue/345/publictest
    cd blockchain-sim
    python setup.py --bitcoin
    python setup.py --test

[Memory dedupliaction]

python setup.py --bitcoin; python setup.py --test
cd cert/memory
python ps_script.py

[TPS]

python setup.py --bitcoin; python setup.py --test
cd cert/perf/TPS
python cert_tps.py

[Latency]

python setup.py --bitcoin; python setup.py --test
cd cert/perf/Latency
python cert_latency.py

[Gossip / Nodediscovery]

cd cert/p2p
python cert_p2p.py