From 8fa353c6a60ec6f0964293224259ee3ad9038404 Mon Sep 17 00:00:00 2001 From: dzhang Date: Thu, 9 Aug 2018 14:27:33 -0700 Subject: [PATCH 1/3] swss: flush g_asicState after each event is done * add flush() after event is handled in case some entries are still in buffer, don't wait * with the changes in sairedis and swss-common, route performance improved by 200~300 routes/sec Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com --- orchagent/orchdaemon.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index 26bd446da27..13e391b8b26 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -313,5 +313,6 @@ void OrchDaemon::start() for (Orch *o : m_orchList) o->doTask(); + flush(); //flush after each event is handled, don't wait } } From 52dfe9fa2ac079ac0b992803537614c8d84a1bff Mon Sep 17 00:00:00 2001 From: dzhang Date: Fri, 10 Aug 2018 15:39:33 -0700 Subject: [PATCH 2/3] swss-common: remove unnecessary flush() in timeout case and update comment *remove unnecessary flush() in timeout case and update comment Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com --- orchagent/orchdaemon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index 13e391b8b26..dcd157058a5 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -313,6 +313,7 @@ void OrchDaemon::start() for (Orch *o : m_orchList) o->doTask(); - flush(); //flush after each event is handled, don't wait + //flush after each event is handled, don't wait timeout + flush(); } } From 9531bcca53d08a8a7b75d9b5fffd131d297ae19f Mon Sep 17 00:00:00 2001 From: dzhang Date: Fri, 10 Aug 2018 15:47:31 -0700 Subject: [PATCH 3/3] swss-common: remove unnecessary flush() in timeout case and update comment *remove unnecessary flush() in timeout case and update comment Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com --- orchagent/orchdaemon.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/orchagent/orchdaemon.cpp b/orchagent/orchdaemon.cpp index dcd157058a5..5b67d71fe88 100644 --- a/orchagent/orchdaemon.cpp +++ b/orchagent/orchdaemon.cpp @@ -294,12 +294,6 @@ void OrchDaemon::start() if (ret == Select::TIMEOUT) { - /* Let sairedis to flush all SAI function call to ASIC DB. - * Normally the redis pipeline will flush when enough request - * accumulated. Still it is possible that small amount of - * requests live in it. When the daemon has nothing to do, it - * is a good chance to flush the pipeline */ - flush(); continue; } @@ -313,7 +307,12 @@ void OrchDaemon::start() for (Orch *o : m_orchList) o->doTask(); - //flush after each event is handled, don't wait timeout + /* Let sairedis to flush all SAI function call to ASIC DB. + * Normally the redis pipeline will flush when enough request + * accumulated. Still it is possible that small amount of + * requests live in it. When the daemon has finished events/tasks, it + * is a good chance to flush the pipeline before next select happened. + */ flush(); } }