Skip to content

Commit

Permalink
1 change buf size from 4KB to 512KB
Browse files Browse the repository at this point in the history
2 remove auto Flush() for every write
  • Loading branch information
cheniujh committed Jul 22, 2024
1 parent 8efcbf0 commit 009952c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/pika_define.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
class PikaServer;
/* Global Const */
constexpr int MAX_DB_NUM = 8;
constexpr int FWRITE_USER_SPACE_BUF_SIZE = 4 << 10;//4KB
constexpr int FWRITE_USER_SPACE_BUF_SIZE = 512LL << 10;//512KB

/* Port shift */
const int kPortShiftRSync = 1000;
Expand Down
6 changes: 3 additions & 3 deletions src/pika_binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ Status Binlog::EmitPhysicalRecord(RecordType t, const char* ptr, size_t n, int*
s = queue_->Append(pstd::Slice(buf, kHeaderSize));
if (s.ok()) {
s = queue_->Append(pstd::Slice(ptr, n));
if (s.ok()) {
s = queue_->Flush();
}
// if (s.ok()) {
// s = queue_->Flush();
// }
}
block_offset_ += static_cast<int32_t>(kHeaderSize + n);

Expand Down

0 comments on commit 009952c

Please sign in to comment.