RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Add time cost when start servers (#12552)
Jin Haia7dd3b7e9e66
diff --git a/admin/server/admin_server.py b/admin/server/admin_server.pyindex b8c96a62c4..2fbb4174c0 100644--- a/admin/server/admin_server.py+++ b/admin/server/admin_server.py@@ -14,10 +14,12 @@# limitations under the License.#+import time+start_ts = time.time()+import osimport signalimport logging-import timeimport threadingimport tracebackimport faulthandler@@ -66,7 +68,7 @@ if __name__ == '__main__':SERVICE_CONFIGS.configs = load_configurations(SERVICE_CONF)try:- logging.info("RAGFlow Admin service start...")+ logging.info(f"RAGFlow admin is ready after {time.time() - start_ts}s initialization.")run_simple(hostname="0.0.0.0",port=9381,diff --git a/api/ragflow_server.py b/api/ragflow_server.pyindex 26cd045c4d..193efff3b2 100644--- a/api/ragflow_server.py+++ b/api/ragflow_server.py@@ -18,8 +18,8 @@# from beartype.claw import beartype_all # <-- you didn't sign up for this# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code-from common.log_utils import init_root_logger-from plugin import GlobalPluginManager+import time+start_ts = time.time()import loggingimport os@@ -40,6 +40,8 @@ from api.db.init_data import init_web_data, init_superuserfrom common.versions import get_ragflow_versionfrom common.config_utils import show_configsfrom common.mcp_tool_call_conn import shutdown_all_mcp_sessions+from common.log_utils import init_root_logger+from plugin import GlobalPluginManagerfrom rag.utils.redis_conn import RedisDistributedLockstop_event = threading.Event()@@ -145,7 +147,7 @@ if __name__ == '__main__':# start http servertry:- logging.info("RAGFlow HTTP server start...")+ logging.info(f"RAGFlow server is ready after {time.time() - start_ts}s initialization.")app.run(host=settings.HOST_IP, port=settings.HOST_PORT)except Exception:traceback.print_exc()diff --git a/rag/svr/sync_data_source.py b/rag/svr/sync_data_source.pyindex eb4445d8e0..764bee8307 100644--- a/rag/svr/sync_data_source.py+++ b/rag/svr/sync_data_source.py@@ -19,6 +19,9 @@# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code+import time+start_ts = time.time()+import asyncioimport copyimport faulthandler@@ -27,7 +30,6 @@ import osimport signalimport sysimport threading-import timeimport tracebackfrom datetime import datetime, timezonefrom typing import Any@@ -1266,6 +1268,7 @@ async def main():signal.signal(signal.SIGINT, signal_handler)signal.signal(signal.SIGTERM, signal_handler)+ logging.info(f"RAGFlow data sync is ready after {time.time() - start_ts}s initialization.")while not stop_event.is_set():await dispatch_tasks()logging.error("BUG!!! You should not reach here!!!")diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.pyindex d397898410..7e2352a9bd 100644--- a/rag/svr/task_executor.py+++ b/rag/svr/task_executor.py@@ -12,6 +12,10 @@# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.++import time+start_ts = time.time()+import asyncioimport socketimport concurrent@@ -21,7 +25,6 @@ import concurrentimport randomimport sysimport threading-import timefrom api.db import PIPELINE_SPECIAL_PROGRESS_FREEZE_TASK_TYPESfrom api.db.services.knowledgebase_service import KnowledgebaseService@@ -1322,6 +1325,8 @@ async def main():report_task = asyncio.create_task(report_status())tasks = []++ logging.info(f"RAGFlow ingestion is ready after {time.time() - start_ts}s initialization.")try:while not stop_event.is_set():await task_limiter.acquire()