Compare commits

...
5 changed files with 103 additions and 17 deletions

No files matched your search

+8
View File
@@ -4,6 +4,14 @@ weight = 3
sort_by = "weight"
insert_anchor_links = "right"
+++
## 2.0.4
### User Visible Changes
- Fixed performance regression in order manager
### Internal changes
- Improved market data diagnostics for bad configurations
- Changed market data default buffer size
## 2.0.3
### Internal changes
- Improved backwards compatibility in UI settings
+1 -1
View File
@@ -98,7 +98,7 @@ message CMEOptions
// Defines amount of time Feed Engine keeps cycling before going to sleep when no useful activity can be done
optional uint32 spin_time = 4 [default = 1];
optional uint32 channels_per_thread = 5 [default = 3];
optional uint32 udp_socket_buffer_size = 11 [default = 33554432]; //32mb
optional uint32 udp_socket_buffer_size = 11 [default = 268435456]; //256mb
}
message CMEChannel {
repeated string id = 2;
@@ -358,7 +358,7 @@ OrderManager::free_buffers(std::string const &session_name) {
}
void OrderManager::init_order_services() {
auto& log = me->services_data.log;
auto &log = me->services_data.log;
for (auto &s : me->services_data.sessions) {
auto gw_name = GatewayName(s->session);
@@ -410,13 +410,14 @@ void OrderManager::init_order_services() {
};
s->exe_report_subs =
std::make_unique<ContentSubscription<NewExecutionReportEvent>>(
*this, gw_name, on_exe_r,log);
*this, gw_name, on_exe_r, log);
s->cancel_reject_subs =
std::make_unique<ContentSubscription<CancelRejectEvent>>(*this,
gw_name,log);
std::make_unique<ContentSubscription<CancelRejectEvent>>(
*this, gw_name, log);
s->gateway_status_subs = std::make_unique<
ContentSubscription<GatewayStatusChangeEvent, NoKey>>(*this, gw_name,log);
ContentSubscription<GatewayStatusChangeEvent, NoKey>>(*this, gw_name,
log);
// publishers for execution reports, gateway status and cancel
// reject evets
@@ -494,18 +495,18 @@ void OrderManager::init_order_services() {
me->services_data.cor_id = ev.trace;
};
me->services_data.md_subs =
std::make_unique<ContentSubscription<BookUpdateEvent>>(*this, on_md_sub,
on_book_update,log);
std::make_unique<ContentSubscription<BookUpdateEvent>>(
*this, on_md_sub, on_book_update, log);
me->services_data.ticker_subs =
std::make_unique<ContentSubscription<TickerUpdateEvent>>(*this,
on_ticker_sub,log);
std::make_unique<ContentSubscription<TickerUpdateEvent>>(
*this, on_ticker_sub, log);
me->services_data.settlement_subs =
std::make_unique<ContentSubscription<SettlementUpdateEvent>>(
*this, on_settlement_sub,log);
*this, on_settlement_sub, log);
me->services_data.time_subs =
std::make_unique<ContentSubscription<TimerEvent, NoKey>>(*this,log);
std::make_unique<ContentSubscription<TimerEvent, NoKey>>(*this, log);
me->services_data.order_creation_subs =
std::make_unique<ContentSubscription<CreateOrderReplyEvent>>(*this,log);
std::make_unique<ContentSubscription<CreateOrderReplyEvent>>(*this, log);
}
void OrderManager::after_event() {
@@ -514,7 +515,8 @@ void OrderManager::after_event() {
for (auto &osd : me->services_data.sessions) {
auto &fix_stream = osd->current_buffer->first_stream();
if (fix_stream.n_msgs()) {
auto scoped_do_work = trace::log_scope(me->services_data.log, {}, "OrderManager::after_event");
auto scoped_do_work = trace::log_scope(me->services_data.log, {},
"OrderManager::after_event");
fix_stream.close();
osd->gw.send_fix(osd->current_buffer, osd->current_trace);
reload_fix_buffer(*osd);
@@ -536,8 +538,10 @@ void OrderManager::reload_fix_buffer(SessionServicesData &osd) {
}
}
void OrderManager::on_poll(trace::PerfLog&log) {
auto scoped_do_work = trace::log_scope(log, {}, "OrderManager::dispatch_incoming_fix_messages");
void OrderManager::on_poll(trace::PerfLog &log) {
auto scoped_do_work =
trace::log_scope(log, {}, "OrderManager::dispatch_incoming_fix_messages",
utils::TimeStamp::Interval::from_microseconds(2));
for (auto &osd : me->services_data.sessions)
osd->gw.dispatch_incoming_fix_messages();
}
@@ -316,7 +316,12 @@ unique_ptr<onixs::Handler> MDP3Main::prepare_handler(const string& channel_id, M
try {
auto handler = unique_ptr<onixs::Handler>(new onixs::Handler(settings));
handler->bindFeedEngine(*_engines.at(options.feed_engine()));
auto iter = _engines.find(options.feed_engine());
if (iter == _engines.end()) {
LOG(md,Fatal, "Missing feed engine definition '{}' for channel id '{}'. Add a feed_engine entry with name:'{}' to the CMEOptions config key.", options.feed_engine(), channel_id, options.feed_engine());
bts_assert_msg(iter != _engines.end(), "Missing feed engine definition.");
}
handler->bindFeedEngine(*(iter->second));
if (recovery) {
handler->bindTcpRecovery(*recovery);
_recovery.push_back(std::move(recovery));
@@ -0,0 +1,69 @@
Test Author: Pedro
If it breaks: Pedro
Spreader Requote Performance test
Note: This test is fairly cumbersome to setup, because performance is
very sensitive to a number of factors including compilation switches,
hardware used, thread allocation and load on the machine. Pedro has
the best handle on how do all this and should probably be the one
doing this test.
1) Make sure you are testing a release server build
2) Make sure you use real hardware, with hyper threading turned off
and cstates disabled, for the server side
3) Make sure you isolate the CPU on which you are running the
server. This is best done on Linux by editing /etc/default/grub like
this:
# this isolates CPU's 0 to 5 for better performance testing
GRUB_CMDLINE_LINUX="isolcpus=0-5"
4) Now make sure your configuration is set for the lowest latency,
including dedicating a thread to the order manager on the isolated
cores:
OrdermanCfg {
value {
executor {
thread_name: "oman_orders"
poll: true
hosted_actor: "MDSource"
hosted_actor: "OrderManager"
}
executor {
thread_name: "oman_slow"
poll: false
hosted_actor: "*"
}
}
}
Threads {
value {
thread_group {name_rx: "mdp3feed" core: 0}
thread_group {name_rx: "oman_orders" core: 1}
thread_group {name_rx: "jf_ar_sim" core: 2}
thread_group {name_rx: ".*" core:6 core:7 core:8 core:9 core:10 }
}
}
5) Now you are ready to start testing. Start a shell and create a new
synthetic say with 2 CL futures. Use the near month (fast ticking)
future as the non quoting leg, so that the other leg gets quoted
often. Make sure to disable throtling in the synthetic definition
dialog.
6) Place an order for this synthetic, away from the market.
7) Now run for say 3 minutes. Visit http://youserver:8000/perf_trace
You should see a graph indicating the median requote times for the
order you created in 5). Make sure you have at least 100 data points
and data the median time is around 12us. If you get anything greater
than 15us, the test has failed.