public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lu <tonylu@linux.alibaba.com>
To: liuyacan@corp.netease.com
Cc: kgraul@linux.ibm.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, linux-s390@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	ubraun@linux.ibm.com
Subject: Re: SMC-R problem under multithread
Date: Mon, 30 May 2022 13:10:19 +0800	[thread overview]
Message-ID: <YpRRuxCs+G6Fp4kT@TonyMac-Alibaba> (raw)
In-Reply-To: <20220530031604.144875-1-liuyacan@corp.netease.com>

On Mon, May 30, 2022 at 11:16:04AM +0800, liuyacan@corp.netease.com wrote:
> Hi experts,
> 
>   I recently used memcached to test the performance of SMC-R relative to TCP, but the results 
>   are confusing me. When using multithread on the server side, the performance of SMC-R is not as good as TCP.
>     
>   Specifically, I tested 4 scenarios with server thread: 1\2\4\8. The client uses 8threads fixedly. 
>   
>   server: (smc_run) memcached -t 1 -m 16384 -p [SERVER-PORT] -U 0 -F -c 10240 -o modern
>   client: (smc-run) memtier_benchmark -s [SERVER-IP] -p [SERVER-PORT] -P memcache_text --random-data --data-size=100 --data-size-pattern=S --key-minimum=30 --key-maximum=100  -n 5000000 -t 8
>   
>   The result is as follows:
>   
>   SMC-R:
>   
>   server-thread    ops/sec  client-cpu server-cpu
>       1             242k        220%         97%
>       2             362k        241%        128%
>       4             378k        242%        160%
>       8             395k        242%        210%
>       
>   TCP:
>   server-thread    ops/sec  client-cpu server-cpu
>       1             185k       224%         100%
>       2             435k       479%         200%
>       4             780k       731%         400%
>       8             938k       800%         659%                   
>    
>   It can be seen that as the number of threads increases, the performance increase of SMC-R is much slower than that of TCP.
> 
>   Am I doing something wrong? Or is it only when CPU resources are tight that SMC-R has a significant advantage ?  
>   
>   Any suggestions are welcome.

Hi Yacan,

This result matches some of our scenarios to some extent. Let's talk
about this result first.

Based on your benchmark, the biggest factor affecting performance seems
that the CPU resource is limited. As the number of threads increased,
neither CPU usage nor performance metrics improved, and CPU is limited
to about 200-250%. To make it clear, could you please give out more
metrics about per-CPU (usr / sys / hi / si) and memcached process usage.

Secondly, it seems that there is lots of connections in this test.
If it takes too much time to establish a connection, or the number of
final connections does not reach the specified value, the result will be
greatly affected. Could you please give out more details about the
connections numbers during benchmark?

We have noticed SMC has some limitations in multiple threads and many
connections. This benchmark happens to be basically in line with this
scenario. In general, there are some aspects in brief:
1. control path (connection setup and dismiss) is not as fast as TCP;
2. data path (lock contention, CQ spreading, etc.) needs further improvement;

About CPU limitation, SMC use one CQ and one core to handle data
transmission, which cannot spread workload over multiple cores. There is
is an early temporary solution [1], which also need to improve (new CQ
API, WR refactor). With this early solution, it shows several times the
performance improvement.

About the improvement of connection setup, you can see [2] for more
details, which is still a proposal now, and we are working on it now.
This show considerable performance boost.

[1] https://lore.kernel.org/all/20220126130140.66316-1-tonylu@linux.alibaba.com/
[2] https://lore.kernel.org/all/1653375127-130233-1-git-send-email-alibuda@linux.alibaba.com/

Thanks,
Tony LU

  reply	other threads:[~2022-05-30  5:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30  3:16 SMC-R problem under multithread liuyacan
2022-05-30  5:10 ` Tony Lu [this message]
2022-05-30  6:40   ` liuyacan
2022-05-30  8:24     ` Tony Lu
2022-05-31  7:02       ` liuyacan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YpRRuxCs+G6Fp4kT@TonyMac-Alibaba \
    --to=tonylu@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=liuyacan@corp.netease.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ubraun@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox