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

运行benchmark出现错误 #41

Closed
Faker0715 opened this issue May 17, 2023 · 4 comments
Closed

运行benchmark出现错误 #41

Faker0715 opened this issue May 17, 2023 · 4 comments

Comments

@Faker0715
Copy link

benchmark.sh: line 17: ./webbench: No such file or directory

@YukunJ
Copy link
Owner

YukunJ commented May 17, 2023

Hi:
Thanks for pointing this out. You might want to cd into the ./webbench folder and run make first. It will build the webbench, the third party pressure test tool. And you may want to tune the test time and concurrent processes, depending on your machine's hardware. (parameters can be found in CMakelists.txt.
I will update the bash script to run this step automatically shortly after.

@Faker0715
Copy link
Author

Faker0715 commented May 17, 2023

抱歉 我还有个问题 我使用的是arch系统 运行benchmark的时候找不到#include <rpc/types.h> 于是我想在benchmark target下面添加目录 但我觉得这不是一种最优的方式 请问有别的方式添加吗 我直接用TARGET_INCLUDE_DIRECTORIES(
benchmark
/usr/include/tirpc
) 会发生错误
下面是暂时能够运行的代码 有点ugly

SET(WEBBENCH_DIR ${PROJECT_SOURCE_DIR}/webbench /usr/include/tirpc)
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
    SET(CONCURRENCY 10500)  # concurrent client number
    SET(DURATION 5)  # stress test duration
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    SET(CONCURRENCY 105)
    SET(DURATION 10)
ENDIF()

ADD_CUSTOM_TARGET(benchmark
        WORKING_DIRECTORY ${WEBBENCH_DIR}
        COMMAND sh /home/faker/Desktop/learn/Turtle/webbench/benchmark.sh ${CONCURRENCY} ${DURATION}
        DEPENDS http_server
        )

@YukunJ
Copy link
Owner

YukunJ commented May 17, 2023

It's great that you can make it work. This is definitely not your problem. (probably the webbench's author's problem for not making its build compatible)

I believe on Ubuntu Linux, the package <rpc/*.h> comes pre-installed. That's why when you are running on a different system, this might become a small problem.

A long-term solution is to include the webbench as a sub-directory into Turtle's CMakeList, and supply necessary packages if needed.

But this might not worth the effort. As long as you can run http_server on your machine, you can boot up any Linux machine that can run webbench and execute webbench from there. The two processes http_server and webbench do not need to run on the same server.

@YukunJ
Copy link
Owner

YukunJ commented May 18, 2023

by sanity check, https://github.com/YukunJ/Turtle/blob/main/webbench/benchmark.sh#L3 indeed already builds the webbench tool

@YukunJ YukunJ closed this as completed May 18, 2023
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

2 participants