|
@@ -46,7 +46,7 @@ float tune_n_sql_connections(int& nc_to_tune, std::string http_req, int port, in
|
|
int nc = min + (max - min) * i / 7;
|
|
int nc = min + (max - min) * i / 7;
|
|
nc_to_tune = nc;
|
|
nc_to_tune = nc;
|
|
|
|
|
|
- float req_per_s = http_benchmark(sockets, 1, 1000, http_req);
|
|
|
|
|
|
+ float req_per_s = http_benchmark(sockets, 4, 1000, http_req);
|
|
std::cout << nc << " -> " << req_per_s << " req/s." << std::endl;
|
|
std::cout << nc << " -> " << req_per_s << " req/s." << std::endl;
|
|
if (req_per_s > max_req_per_s)
|
|
if (req_per_s > max_req_per_s)
|
|
{
|
|
{
|
|
@@ -191,6 +191,7 @@ int main(int argc, char* argv[]) {
|
|
response.write(ss.to_string_view());
|
|
response.write(ss.to_string_view());
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#ifndef PLAINTEXT_ONLY
|
|
// Tune the number of sql connections.
|
|
// Tune the number of sql connections.
|
|
int tunning_port = port+1;
|
|
int tunning_port = port+1;
|
|
std::thread server_thread([&] {
|
|
std::thread server_thread([&] {
|
|
@@ -206,6 +207,7 @@ int main(int argc, char* argv[]) {
|
|
li::quit_signal_catched = true;
|
|
li::quit_signal_catched = true;
|
|
server_thread.join();
|
|
server_thread.join();
|
|
li::quit_signal_catched = false;
|
|
li::quit_signal_catched = false;
|
|
|
|
+#endif
|
|
|
|
|
|
// Start the server for the Techempower benchmark.
|
|
// Start the server for the Techempower benchmark.
|
|
http_serve(my_api, port, s::nthreads = nprocs);
|
|
http_serve(my_api, port, s::nthreads = nprocs);
|