From da7300bc9b67d64b185ee56e9b52c185751de9c8 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Fri, 22 Nov 2019 09:26:47 +0800 Subject: [PATCH] change comment/information in config files and codes --- conf/storage.conf | 18 ++++++++++++------ conf/tracker.conf | 9 +++++---- storage/storage_service.c | 8 +++++--- tracker/tracker_nio.c | 9 +++++---- tracker/tracker_service.c | 6 +++--- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/conf/storage.conf b/conf/storage.conf index 0a3b599..76f2529 100644 --- a/conf/storage.conf +++ b/conf/storage.conf @@ -24,31 +24,37 @@ client_bind=true port=23000 # connect timeout in seconds -# default value is 30s +# default value is 30 # Note: in the intranet network (LAN), 2 seconds is enough. connect_timeout=10 # network timeout in seconds for send and recv -# default value is 30s +# default value is 30 network_timeout=60 -# heart beat interval in seconds +# the heart beat interval in seconds +# the storage server send heartbeat to tracker server periodically +# default value is 30 heart_beat_interval=30 # disk usage report interval in seconds +# the storage server send disk usage report to tracker server periodically +# default value is 300 stat_report_interval=60 # the base path to store data and log files +# NOTE: the binlog files maybe are large, make sure +# the base path has enough disk space base_path=/home/yuqing/fastdfs # max concurrent connections the server supported -# default value is 256 -# more max_connections means more memory will be used # you should set this parameter larger, eg. 10240 +# default value is 256 max_connections=1024 # the buff size to recv / send data from/to network # this parameter must more than 8KB +# 256KB or 512KB is recommended # default value is 64KB # since V2.00 buff_size = 256KB @@ -295,7 +301,7 @@ connection_pool_max_idle_time = 3600 # if compress the binlog files by gzip # default value is false # since V6.01 -compress_binlog = false +compress_binlog = true # try to compress binlog time, time format: Hour:Minute # Hour from 0 to 23, Minute from 0 to 59 diff --git a/conf/tracker.conf b/conf/tracker.conf index 6c5f8c5..52f5f8b 100644 --- a/conf/tracker.conf +++ b/conf/tracker.conf @@ -11,19 +11,20 @@ bind_addr= port=22122 # connect timeout in seconds -# default value is 30s +# default value is 30 # Note: in the intranet network (LAN), 2 seconds is enough. connect_timeout=10 # network timeout in seconds for send and recv -# default value is 30s +# default value is 30 network_timeout=60 # the base path to store data and log files base_path=/home/yuqing/fastdfs -# max concurrent connections this server supported -# you should set this parameter larger, eg. 102400 +# max concurrent connections this server support +# you should set this parameter larger, eg. 10240 +# default value is 256 max_connections=1024 # accept thread count diff --git a/storage/storage_service.c b/storage/storage_service.c index 2abc477..5ee573d 100644 --- a/storage/storage_service.c +++ b/storage/storage_service.c @@ -1834,9 +1834,11 @@ static void *accept_thread_entrance(void* arg) pTask = free_queue_pop(); if (pTask == NULL) { - logError("file: "__FILE__", line: %d, " \ - "malloc task buff failed", \ - __LINE__); + logError("file: "__FILE__", line: %d, " + "malloc task buff fail, you should " + "increase the parameter \"max_connections\" " + "in storage.conf, or check your applications " + "for connection leaks", __LINE__); close(incomesock); continue; } diff --git a/tracker/tracker_nio.c b/tracker/tracker_nio.c index 796843e..9d1f69f 100644 --- a/tracker/tracker_nio.c +++ b/tracker/tracker_nio.c @@ -134,10 +134,11 @@ void recv_notify_read(int sock, short event, void *arg) pTask = free_queue_pop(); if (pTask == NULL) { - logError("file: "__FILE__", line: %d, " \ - "malloc task buff failed, you should " \ - "increase the parameter: max_connections", \ - __LINE__); + logError("file: "__FILE__", line: %d, " + "malloc task buff fail, you should " + "increase the parameter \"max_connections\" " + "in tracker.conf, or check your applications " + "for connection leaks", __LINE__); close(incomesock); continue; } diff --git a/tracker/tracker_service.c b/tracker/tracker_service.c index 7f56eab..7316740 100644 --- a/tracker/tracker_service.c +++ b/tracker/tracker_service.c @@ -588,14 +588,14 @@ static int tracker_deal_changelog_req(struct fast_task_info *pTask) break; } - memcpy(group_name, pTask->data + sizeof(TrackerHeader), \ + memcpy(group_name, pTask->data + sizeof(TrackerHeader), FDFS_GROUP_NAME_MAX_LEN); *(group_name + FDFS_GROUP_NAME_MAX_LEN) = '\0'; pGroup = tracker_mem_get_group(group_name); if (pGroup == NULL) { - logError("file: "__FILE__", line: %d, " \ - "client ip: %s, invalid group_name: %s", \ + logError("file: "__FILE__", line: %d, " + "client ip: %s, group_name: %s not exist", __LINE__, pTask->client_ip, group_name); result = ENOENT; break;