Skip to content

Commit ca7e0e2

Browse files
authored
Update h2 windowing algo & Http Client benchmark (#388)
1 parent 79016da commit ca7e0e2

26 files changed

+1410
-300
lines changed

.github/workflows/ci.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ jobs:
6464
- name: gcc-8
6565
- name: gcc-11
6666
- name: gcc-13
67-
# See Issue: https://github.com/llvm/llvm-project/issues/59007. Although this issue
68-
# has been fixed in LLVM, the fix will probably not propagate to older versions of Ubuntu and GCC 13.1.
67+
# See Issue: https://github.com/llvm/llvm-project/issues/59007. Although this issue
68+
# has been fixed in LLVM, the fix will probably not propagate to older versions of Ubuntu and GCC 13.1.
6969
#
70-
# Starting with GLIBC version 2.34, the `dn_expand` function, previously found in `libresolv.so`, was moved to `libc.so`. This
70+
# Starting with GLIBC version 2.34, the `dn_expand` function, previously found in `libresolv.so`, was moved to `libc.so`. This
7171
# function is used internally by the `getaddrinfo()` system call.
7272
#
73-
# In our setup (As of December 2024), we are using an Ubuntu 18 Docker image on a newer Ubuntu host.
73+
# In our setup (As of December 2024), we are using an Ubuntu 18 Docker image on a newer Ubuntu host.
7474
# However, due to compatibility issues between newer libasan.so in GCC 13.1
75-
# and the older Ubuntu image, the linker does not link with `libresolv.so`.
75+
# and the older Ubuntu image, the linker does not link with `libresolv.so`.
7676
# This results in crashes in `getaddrinfo()` since Ubuntu-18 GLIBC is 2.31.
7777
#
78-
# This problem does not occur on Ubuntu 22 and newer because GLIBC versions 2.34
79-
# and above include `dn_expand` in `libc.so`, eliminating the dependency on
78+
# This problem does not occur on Ubuntu 22 and newer because GLIBC versions 2.34
79+
# and above include `dn_expand` in `libc.so`, eliminating the dependency on
8080
# `libresolv.so`.
8181
#
82-
# We can bypass this problem by linking with "resolv" manually until we bump
82+
# We can bypass this problem by linking with "resolv" manually until we bump
8383
# our base Linux image to Ubuntu 22.
84-
extra-build-flag: --cmake-extra=-DCMAKE_EXE_LINKER_FLAGS="-lresolv"
84+
extra-build-flag: --cmake-extra=-DCMAKE_EXE_LINKER_FLAGS="-lresolv"
8585
steps:
8686
- uses: aws-actions/configure-aws-credentials@v4
8787
with:

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,6 @@ if (NOT BYO_CRYPTO AND BUILD_TESTING)
8383
add_subdirectory(tests)
8484
if (NOT CMAKE_CROSSCOMPILING)
8585
add_subdirectory(bin/elasticurl)
86+
add_subdirectory(bin/h2benchmark)
8687
endif()
8788
endif()

bin/h2benchmark/CMakeLists.txt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
project(h2benchmark C)
2+
3+
file(GLOB H2BENCHMARK_SRC
4+
"*.c"
5+
)
6+
7+
set(PROJECT_NAME h2benchmark)
8+
add_executable(${PROJECT_NAME} ${H2BENCHMARK_SRC})
9+
aws_set_common_properties(${PROJECT_NAME})
10+
11+
target_link_libraries(${PROJECT_NAME} aws-c-http)
12+
13+
if (BUILD_SHARED_LIBS AND NOT WIN32)
14+
message(INFO " h2benchmark will be built with shared libs, but you may need to set LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib to run the application")
15+
endif()
16+
17+
install(TARGETS ${PROJECT_NAME}
18+
EXPORT ${PROJECT_NAME}-targets
19+
COMPONENT Runtime
20+
RUNTIME
21+
DESTINATION ${CMAKE_INSTALL_BINDIR}
22+
COMPONENT Runtime)

bin/h2benchmark/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# HTTP/2 benchmark
2+
3+
this is a C program mimic the API call benchmark from aws-java-sdk-v2. https://github.com/aws/aws-sdk-java-v2/tree/master/test/sdk-benchmarks/src/main/java/software/amazon/awssdk/benchmark/apicall/httpclient
4+
5+
It collects how many API calls finish per second. Basically how many request can made per second.
6+
7+
The program connects to the local host that can be found [here](../../tests/py_localhost).
8+
9+
To run the benchmark, build the h2benchmark with aws-c-http as dependency.
10+
TODO: Currently the configs are all hardcoded.

0 commit comments

Comments
 (0)