Skip to content

Commit 57f2f11

Browse files
authored
H2O: Use 2 database connections per thread again (#9176)
1 parent 1a62761 commit 57f2f11

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

frameworks/C/h2o/h2o.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ CMD ["taskset", \
109109
"dbname=hello_world host=tfb-database password=benchmarkdbpass sslmode=disable user=benchmarkdbuser", \
110110
"-f", \
111111
"/opt/h2o_app/share/h2o_app/template", \
112-
"-m1"]
112+
"-m2"]

frameworks/C/h2o/src/handlers/world.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ static int do_multiple_queries(bool do_update, bool use_cache, h2o_req_t *req)
237237

238238
const size_t num_query = get_query_number(req);
239239

240-
// MAX_QUERIES is a relatively small number, so assume no overflow in the following
241-
// arithmetic operations.
242-
assert(num_query && num_query <= MAX_QUERIES);
240+
// MAX_QUERIES is a relatively small number, say less than or equal to UINT16_MAX, so assume no
241+
// overflow in the following arithmetic operations.
242+
assert(num_query && num_query <= MAX_QUERIES && num_query <= UINT16_MAX);
243243

244244
size_t base_size = offsetof(multiple_query_ctx_t, res) + num_query * sizeof(query_result_t);
245245

@@ -373,7 +373,7 @@ static void do_updates(multiple_query_ctx_t *query_ctx)
373373
for (size_t i = 0; i < query_ctx->num_result; i++) {
374374
query_ctx->res[i].id = htonl(query_ctx->res[i].id);
375375
query_ctx->res[i].random_number =
376-
htonl(1 + get_random_number(MAX_ID, &query_ctx->ctx->random_seed));
376+
htonl(1 + get_random_number(MAX_ID, &query_ctx->ctx->random_seed));
377377
paramFormats[2 * i] = 1;
378378
paramFormats[2 * i + 1] = 1;
379379
paramLengths[2 * i] = sizeof(query_ctx->res[i].id);

0 commit comments

Comments
 (0)