SPARK-1686, Towards better server side performance.
This commit is contained in:
1 parent
05741ceab0
commit
ded957a0ef
27 files changed
+247
-3595
No files matched your search
@@ -3,6 +3,7 @@
|
||||
#include "lib/api/services/AdminService.client.pb.h"
|
||||
#include "lib/config/config.h"
|
||||
#include "lib/config/protos/jetfix.pb.h"
|
||||
#include "lib/config/protos/orderman_cfg.pb.h"
|
||||
#include "lib/md/MDConsumer.h"
|
||||
#include "lib/mercury/actors/Timer.h"
|
||||
#include "lib/mercury/broker/AsyncEventBroker.h"
|
||||
@@ -80,7 +81,7 @@ OrderServiceServer::OrderServiceServer(
|
||||
|
||||
auto &all_connections = config::get<config::JetFIX>().connection();
|
||||
for (auto const &c : all_connections)
|
||||
me->fast_exe.spawn<ExecutionGateway>(c,stats);
|
||||
me->fast_exe.spawn<ExecutionGateway>(c, stats);
|
||||
|
||||
me->fast_thread = std::thread([this]() {
|
||||
os::set_thread_name("fast_exe");
|
||||
@@ -102,6 +103,22 @@ OrderServiceServer::OrderServiceServer(
|
||||
}
|
||||
});
|
||||
|
||||
auto fast_thread_core =
|
||||
config::get<config::OrdermanCfg>().fast_thread_affinity();
|
||||
if (fast_thread_core >= 0) {
|
||||
LOG(OrderMan, Info, "Setting fast thread core affinity to {}",
|
||||
fast_thread_core);
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
CPU_SET(fast_thread_core, &cpuset);
|
||||
int rc = pthread_setaffinity_np(me->fast_thread.native_handle(),
|
||||
sizeof(cpu_set_t), &cpuset);
|
||||
if (rc != 0)
|
||||
LOG(OrderMan, Error,
|
||||
"Could not set core affinity to {} for fast thread. Error code={}",
|
||||
fast_thread_core, rc);
|
||||
}
|
||||
|
||||
// slow actors
|
||||
me->slow_exe.activate(me->service_bridge);
|
||||
me->slow_exe.spawn<mercury::Timer>();
|
||||
|
||||
Reference in new issue
Block a user