Skip to content

Commit

Permalink
update on testing: lower latency with new CPU, still not ideal throug…
Browse files Browse the repository at this point in the history
…hput
  • Loading branch information
shuwens committed Oct 30, 2024
1 parent 7f876d2 commit 5885adc
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 34 deletions.
3 changes: 2 additions & 1 deletion src/common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ auto zoneRead(void *arg1) -> net::awaitable<Result<void>>
cpl = res_cpl.value();
timer.t6 = std::chrono::high_resolution_clock::now();

if (ctx->ctrl->mTotalCounts % Configuration::GetSamplingRate() == 0)
if (ctx->ctrl->mTotalCounts % Configuration::GetSamplingRate() == 0 ||
tdiff_us(timer.t6, timer.t1) > 1000)
log_debug(
"t2-t1 {}us, t3-t2 {}us, t4-t3 {}us, t5-t4 {}us, t6-t5 {}us ",
tdiff_us(timer.t2, timer.t1), tdiff_us(timer.t3, timer.t2),
Expand Down
3 changes: 2 additions & 1 deletion src/include/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ class Configuration
int gSamplingRate = 1000;

// manually set the zone id
const int gCurrentZone1 = 81;
// const int gCurrentZone1 = 81;
const int gCurrentZone2 = 115;
const int gCurrentZone1 = 50;

bool gVerbose = false; // this will turn on all logs
bool gDebug = false; // this will turn on all checks
Expand Down
49 changes: 27 additions & 22 deletions src/include/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,35 @@ auto awaitable_on_request(HttpRequest req,
auto res = co_await zoneRead(s1);
// co_await (zoneRead(s1) && zoneRead(s2) && zoneRead(s3));

s1->Clear();
zctrl_.mRequestContextPool->ReturnRequestContext(s1);

co_return handle_request(std::move(req));

// log_debug("1111");

if (res.has_value()) {
// log_debug("1111");
// }
ZstoreObject deserialized_obj;
bool success = ReadBufferToZstoreObject(
s1->dataBuffer, s1->size, deserialized_obj);

// log_debug("1111");
s1->Clear();
zctrl_.mRequestContextPool->ReturnRequestContext(s1);
// s2->Clear();
// zctrl_.mRequestContextPool->ReturnRequestContext(s2);
// s3->Clear();
// zctrl_.mRequestContextPool->ReturnRequestContext(s3);

co_return handle_request(std::move(req));
} else {
s1->Clear();
zctrl_.mRequestContextPool->ReturnRequestContext(s1);

co_return handle_request(std::move(req));
}
// if (res.has_value()) {
// // log_debug("1111");
// // }
// ZstoreObject deserialized_obj;
// bool success = ReadBufferToZstoreObject(
// s1->dataBuffer, s1->size, deserialized_obj);
//
// // log_debug("1111");
// s1->Clear();
// zctrl_.mRequestContextPool->ReturnRequestContext(s1);
// // s2->Clear();
// // zctrl_.mRequestContextPool->ReturnRequestContext(s2);
// // s3->Clear();
// // zctrl_.mRequestContextPool->ReturnRequestContext(s3);
//
// co_return handle_request(std::move(req));
// } else {
// s1->Clear();
// zctrl_.mRequestContextPool->ReturnRequestContext(s1);
//
// co_return handle_request(std::move(req));
// }
} else {
log_error("Draining or not enough contexts");
}
Expand Down
2 changes: 1 addition & 1 deletion utils/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ s3bench -accessKey=KEY -accessSecret=SECRET \
-bucket=db -operations=write \
-numClients=100 -numSamples=1000 \
-objectSize=4096 \
-endpoint=http://127.0.0.1:2000
-endpoint=http://12.12.12.1:2000

7 changes: 6 additions & 1 deletion utils/bench_read.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ set -xeuo pipefail

# sudo nice -n -20 taskset -c 8-11 ~/tools/wrk/wrk -t16 -c800 -d30s -s random-reads.lua http://127.0.0.1:2000 -- 100000 false
# sudo taskset -c 0,4,5 ~/tools/wrk/wrk -t16 -c800 -d30s -s random-reads.lua http://127.0.0.1:2000 -- 100000 false
sudo taskset -c 3,4,5 ~/tools/wrk/wrk -t16 -c800 -d10s -s random-reads.lua http://127.0.0.1:2000 -- 100000 false
# sudo taskset -c 3,4,5 ~/tools/wrk/wrk -t16 -c800 -d10s -s random-reads.lua http://127.0.0.1:2000 -- 100000 false


# sudo ~/tools/wrk/wrk -t1 -c1 -d1s -s random-reads.lua http://12.12.12.1:2000 -- 100000 false

sudo taskset -c 8-15 ~/tools/wrk/wrk -t16 -c80 -d5s -s random-reads.lua http://12.12.12.1:2000 -- 100000 false
16 changes: 8 additions & 8 deletions utils/dpdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ fi

HUGEMEM=4096 ./scripts/setup.sh

if [[ $(hostname) == "zstore1" ]]; then
sudo ifconfig enp1s0d1 12.12.12.1/24 up
# sudo ifconfig ibp1s0 12.12.12.1/24 up
fi
if [[ $(hostname) == "zstore2" ]]; then
sudo ifconfig enp1s0d1 12.12.12.2/24 up
# sudo ifconfig ibp1s0 12.12.12.2/24 up
fi
# if [[ $(hostname) == "zstore1" ]]; then
# # sudo ifconfig enp1s0d1 12.12.12.1/24 up
# # sudo ifconfig ibp1s0 12.12.12.1/24 up
# fi
# if [[ $(hostname) == "zstore2" ]]; then
# # sudo ifconfig enp1s0d1 12.12.12.2/24 up
# # sudo ifconfig ibp1s0 12.12.12.2/24 up
# fi

0 comments on commit 5885adc

Please sign in to comment.