DPDK usage discussions
 help / color / mirror / Atom feed
From: amit sehas <cun23@yahoo.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Nishant Verma <vnish11@gmail.com>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: core performance
Date: Fri, 27 Sep 2024 03:23:01 +0000 (UTC)	[thread overview]
Message-ID: <781570616.13263184.1727407381739@mail.yahoo.com> (raw)
In-Reply-To: <894778529.13304006.1727406828202@mail.yahoo.com>

For a weaker AWS instance this is what we find with cpu_layout.py:

 ======================================================================
Core and Socket Information (as reported by '/sys/devices/system/cpu')
======================================================================
cores =  [0, 1]
sockets =  [0]

       Socket 0
       --------
Core 0 [0, 2]
Core 1 [1, 3]


So from this we deduce that logical core 0 and logical core 2 are on the same physical core
and 1, 3 are on the other physical core,  learnt something valuable today ...

regards





On Thursday, September 26, 2024 at 08:13:48 PM PDT, amit sehas <cun23@yahoo.com> wrote: 





Thanks for the suggestion, i didnt even know about cpu_layout.py ... i will definitely try it.... i made some more measurements and so far this is the hypothesis:

1) 8 hyperthreads are not the same as 8 CPUs, the scale up is not linear.
2) the vCPU cache allocation per logical CPU thread is also important, if 2 threads are running the same code on the same physical core but 2 different logical cores then we will not have cores competing with each other.
3) try to run dissimilar code on the logical cores that run on the same physical core ...

the cpu map is deinitely worth figuring out ...

regards





On Thursday, September 26, 2024 at 08:03:30 PM PDT, Stephen Hemminger <stephen@networkplumber.org> wrote: 





On Thu, 26 Sep 2024 17:03:17 +0000 (UTC)

amit sehas <cun23@yahoo.com> wrote:

> If there is a way to determine:
> 
> vCPU thread utilization numbers over a period of time, such as a few hours
> 
> or which processes are consuming the most CPU
> 
> top always indicates that the server is consuming the most CPU.
> 
> Now i am begining to wonder if 8 vCPU threads really are capable of running 6 high intensity threads or only 4 such threads? Dont know
> 
> Also tried to utilize pthread_setschedparam() explicitly on some of the threads, it made no difference to the performance. But if we do it on more than 1-2 threads then it hangs the whole system.
> 
> This is primarily a matter of CPU scheduling, and if we restirct context switching on even 2 critical threads we have a win.

> 
> 

Some other recommendations.
  - avoid CPU 0 you can't isolate it, and it has other stuff that has to run there
    if you have main thread that sleeps, and worker threads that poll, then
    go ahead and put main on cpu 0.

  - don't put two active polling cores on shared hyper-thread.
    You can used DPDK's cpu_layout.py script to show this.

For example:

$ ./usertools/cpu_layout.py 
======================================================================
Core and Socket Information (as reported by '/sys/devices/system/cpu')
======================================================================

cores =  [0, 1, 2, 3]
sockets =  [0]

      Socket 0    
      --------    
Core 0 [0, 4]      
Core 1 [1, 5]      
Core 2 [2, 6]      
Core 3 [3, 7] 

On this system, don't poll on cores 0 and 4 (system activity).
Use lcore 1, 2, 3 




  reply	other threads:[~2024-09-27  3:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1987164393.11670398.1727125003663.ref@mail.yahoo.com>
2024-09-23 20:56 ` amit sehas
2024-09-23 21:56   ` Wisam Jaddo
2024-09-23 22:17     ` Nishant Verma
2024-09-23 23:17       ` amit sehas
2024-09-24  1:14         ` Nishant Verma
     [not found]           ` <2025533199.11789856.1727143607670@mail.yahoo.com>
     [not found]             ` <CAHhCjUFjqobchJ79z0BLLRXrLZdb2QyVPM6fbji6T7jpiKLa2Q@mail.gmail.com>
2024-09-24 14:40               ` amit sehas
2024-09-24 16:38                 ` Stephen Hemminger
2024-09-24 20:47                   ` amit sehas
2024-09-26 12:32                     ` amit sehas
2024-09-26 16:56                       ` amit sehas
2024-09-26 17:03                         ` amit sehas
2024-09-27  3:03                           ` Stephen Hemminger
2024-09-27  3:13                             ` amit sehas
2024-09-27  3:23                               ` amit sehas [this message]
2024-09-24 13:25         ` Stephen Hemminger

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=781570616.13263184.1727407381739@mail.yahoo.com \
    --to=cun23@yahoo.com \
    --cc=stephen@networkplumber.org \
    --cc=users@dpdk.org \
    --cc=vnish11@gmail.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;
as well as URLs for NNTP newsgroup(s).