Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
873fbb52
Commit
873fbb52
authored
Oct 13, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port docs on -free_memory_to_system_interval from wiki
parent
c40418cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
server.md
docs/cn/server.md
+4
-0
server.md
docs/en/server.md
+4
-0
No files found.
docs/cn/server.md
View file @
873fbb52
...
...
@@ -379,6 +379,10 @@ Server.set_version(...)可以为server设置一个名称+版本,可通过/vers
未打印日志的开销只是一次if判断,也不会评估参数(比如某个参数调用了函数,日志不打,这个函数就不会被调用)。如果日志最终打印到自定义LogSink,那么还要经过LogSink的过滤。
## 归还空闲内存至系统
选项-free_memory_to_system_interval表示每过这么多秒就尝试向系统归还空闲内存,<= 0表示不开启,默认值为0,若开启建议设为10及以上的值。此功能支持tcmalloc,之前程序中对`MallocExtension::instance()->ReleaseFreeMemory()`的定期调用可改成设置此选项。
## 打印发送给client的错误
server的框架部分一般不针对个别client打印错误日志,因为当大量client出现错误时,可能导致server高频打印日志而严重影响性能。但有时为了调试问题,或就是需要让server打印错误,打开参数[-log_error_text](http://brpc.baidu.com:8765/flags/log_error_text)即可。
...
...
docs/en/server.md
View file @
873fbb52
...
...
@@ -381,6 +381,10 @@ Only logs with levels **not less than** the level specified by -minloglevel are
Overhead
of
unprinted
logs
is
just
a
"if"
test
and
parameters
are
not
evaluated
(
For
example
a
parameter
calls
a
function
,
if
the
log
is
not
printed
,
the
function
is
not
called
).
Logs
printed
to
LogSink
may
be
filtered
by
the
sink
as
well
.
## Return free memory to system
Set
gflag
-
free_memory_to_system_interval
to
make
the
program
try
to
return
free
memory
to
system
every
so
many
seconds
,
values
<=
0
disable
the
feature
.
Default
value
is
0.
To
turn
it
on
,
values
>=
10
are
recommended
.
This
feature
supports
tcmalloc
,
thus
`
MallocExtension
::
instance
()
->
ReleaseFreeMemory
()
`
periodically
called
in
your
program
can
be
replaced
by
setting
this
flag
.
## Log error to clients
Framework
does
not
print
logs
for
specific
client
generally
,
because
a
lot
of
errors
caused
by
clients
may
slow
down
server
significantly
due
to
frequent
printing
of
logs
.
If
you
need
to
debug
or
just
want
the
server
to
log
all
errors
,
turn
on
[
-
log_error_text
](
http
:
//brpc.baidu.com:8765/flags/log_error_text).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment