netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	netdev@vger.kernel.org, Sabrina Dubroca <sd@queasysnail.net>,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2 net-next v2 3/4] ss: Buffer raw fields first, then render them as a table
Date: Wed, 13 Feb 2019 18:22:55 +0100	[thread overview]
Message-ID: <20190213182012.34a6928f@redhat.com> (raw)
In-Reply-To: <20190213085101.7474ba5d@shemminger-XPS-13-9360>

On Wed, 13 Feb 2019 08:51:01 -0800
Stephen Hemminger <stephen@networkplumber.org> wrote:

> On Wed, 13 Feb 2019 09:37:11 +0100
> Stefano Brivio <sbrivio@redhat.com> wrote:
> 
> > On Tue, 12 Feb 2019 16:42:04 -0800
> > Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >   
> > > I do not get it.
> > > 
> > > "ss -emoi " uses almost 1KB per socket.
> > > 
> > > 10,000,000 sockets -> we need about 10GB of memory  ???
> > > 
> > > This is a serious regression.    
> > 
> > I guess this is rather subjective: the worst case I considered back then
> > was the output of 'ss -tei0' (less than 500 bytes) for one million
> > sockets, which gives 500M of memory, which should in turn be fine on a
> > machine handling one million sockets.
> > 
> > Now, if 'ss -emoi' on 10 million sockets is an actual use case (out of
> > curiosity: how are you going to process that output? Would JSON help?),
> > I see two easy options to solve this:
> > 
> > 1. flush the output every time we reach a given buffer size (1M
> >    perhaps). This might make the resulting blocks slightly unaligned,
> >    with occasional loss of readability on lines occurring every 1k to
> >    10k sockets approximately, even though after 1k sockets column sizes
> >    won't change much (it looks anyway better than the original), and I
> >    don't expect anybody to actually scroll that output
> > 
> > 2. add a switch for unbuffered output, but then you need to remember to
> >    pass it manually, and the whole output would be as bad as the
> >    original in case you need the switch.
> > 
> > I'd rather go with 1., it's easy to implement (we already have partial
> > flushing with '--events') and it looks like a good compromise on
> > usability. Thoughts?
> >   
> I agree with eric. The benefits of buffering are not worth it.
> Let's just choose a reasonable field width, if something is too big, columns won't line up
> which i snot a big deal.

That's how it was before, and we couldn't even get fields aligned with
TCP and UDP sockets in a 80 columns wide terminal. See examples at:
https://patchwork.ozlabs.org/cover/847301/.

I tried, but I think it's impossible to find a "reasonable" field
width, especially when you mix a number of socket types.

> Unless you come up with a better solution, I am going to revert this.

That's why I asked for feedback about my proposals 1. and 2. above.
I'll go for 1. then.

-- 
Stefano

  reply	other threads:[~2019-02-13 17:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12  0:46 [PATCH iproute2 net-next v2 0/4] Abstract columns, properly space and wrap fields Stefano Brivio
2017-12-12  0:46 ` [PATCH iproute2 net-next v2 1/4] ss: Replace printf() calls for "main" output by calls to helper Stefano Brivio
2017-12-12  0:46 ` [PATCH iproute2 net-next v2 2/4] ss: Introduce columns lightweight abstraction Stefano Brivio
2017-12-12  0:46 ` [PATCH iproute2 net-next v2 3/4] ss: Buffer raw fields first, then render them as a table Stefano Brivio
2019-02-13  0:42   ` Eric Dumazet
2019-02-13  8:37     ` Stefano Brivio
2019-02-13 16:51       ` Stephen Hemminger
2019-02-13 17:22         ` Stefano Brivio [this message]
2019-02-13 17:32           ` Eric Dumazet
2019-02-13 17:31       ` Eric Dumazet
2019-02-13 17:38         ` Stefano Brivio
2019-02-13 18:01           ` Eric Dumazet
2019-02-13 21:17         ` Stefano Brivio
2019-02-13 21:55           ` Stephen Hemminger
2019-02-13 22:20             ` Stefano Brivio
2019-02-13 23:39             ` Phil Sutter
2019-02-13 23:47               ` David Ahern
2017-12-12  0:46 ` [PATCH iproute2 net-next v2 4/4] ss: Implement automatic column width calculation Stefano Brivio
2017-12-12 20:13 ` [PATCH iproute2 net-next v2 0/4] Abstract columns, properly space and wrap fields 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=20190213182012.34a6928f@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    --cc=stephen@networkplumber.org \
    /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).