Go to file
Stefano Brivio aa5bd6a252 ss: Render buffer to output every time a number of chunks are allocated
Eric reported that, with 10 million sockets, ss -emoi (about 1000 bytes
output per socket) can easily lead to OOM (buffer would grow to 10GB of
memory).

Limit the maximum size of the buffer to five chunks, 1M each. Render and
flush buffers whenever we reach that.

This might make the resulting blocks slightly unaligned between them, with
occasional loss of readability on lines occurring every 5k to 50k sockets
approximately. Something like (from ss -tu):

[...]
CLOSE-WAIT   32       0           192.168.1.50:35232           10.0.0.1:https
ESTAB        0        0           192.168.1.50:53820           10.0.0.1:https
ESTAB       0        0           192.168.1.50:46924            10.0.0.1:https
CLOSE-WAIT  32       0           192.168.1.50:35228            10.0.0.1:https
[...]

However, I don't actually expect any human user to scroll through that
amount of sockets, so readability should be preserved when it matters.

The bulk of the diffstat comes from moving field_next() around, as we now
call render() from it. Functionally, this is implemented by six lines of
code, most of them in field_next().

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Fixes: 691bd854bf ("ss: Buffer raw fields first, then render them as a table")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2019-02-21 14:45:45 -08:00
bash-completion tc: gred: support controlling RED flags 2018-11-24 07:11:36 -08:00
bridge bridge: fdb: Fix FDB dump with strict checking disabled 2019-02-05 15:27:28 -08:00
devlink devlink: relax dpipe table show dependency on resources 2019-02-21 14:21:19 -08:00
doc/actions doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
etc/iproute2 iproute2: Add support for a few routing protocols 2018-06-11 11:18:30 -07:00
examples examples: Remove cbq.init-v0.7.3 2018-12-18 10:52:35 -08:00
genl genl: remove dead code 2018-11-19 11:42:44 -08:00
include uapi: update inet_diag_info.h 2019-02-21 14:24:07 -08:00
ip ip-address: Use correct max attribute value in print_vf_stats64() 2019-02-21 14:16:08 -08:00
lib lib/libnetlink: ensure a minimum of 32KB for the buffer used in rtnl_recvmsg() 2019-02-13 13:51:44 -08:00
man bridge: make mcast_flood description consistent 2019-02-21 14:22:05 -08:00
misc ss: Render buffer to output every time a number of chunks are allocated 2019-02-21 14:45:45 -08:00
netem doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
rdma rdma: update uapi headers 2019-01-07 11:41:39 -08:00
schema bridge: add json schema for bridge fdb show 2016-07-20 12:02:02 -07:00
tc tc: use bits not mbits/sec in rate percent 2019-02-08 09:59:45 -08:00
testsuite Merge branch 'iproute2-master' into iproute2-next 2019-01-04 12:22:47 -08:00
tipc tipc: fix misalignment printout in non-JSON output 2018-12-07 09:24:01 -08:00
.gitignore Remove leftovers from removed Latex documentation 2018-02-13 16:43:19 -08:00
configure configure: fix typo in check_xt_old_internal_h 2019-01-07 14:42:01 -08:00
COPYING Update address of FSF in license 2008-03-08 13:31:03 -08:00
Makefile Makefile: check manpages for syntax errors 2019-01-14 08:01:51 -08:00
README README: update libdb build dependency information 2018-05-01 19:29:03 -07:00
README.devel README: update location of git repositories, remove broken info link 2018-02-13 16:42:51 -08:00
README.distribution README cleanup's 2012-01-03 15:04:55 -08:00
README.iproute2+tc doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00
README.lnstat doc: remove trailing whitespace 2018-12-19 12:02:38 -08:00

This is a set of utilities for Linux networking.

Information:
    https://wiki.linuxfoundation.org/networking/iproute2

Download:
    http://www.kernel.org/pub/linux/utils/net/iproute2/

Stable version repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2.git

Development repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git

How to compile this.
--------------------
1. libdbm

arpd needs to have the berkeleydb development libraries. For Debian
users this is the package with a name like libdbX.X-dev.
DBM_INCLUDE points to the directory with db_185.h which
is the include file used by arpd to get to the old format Berkeley
database routines.  Often this is in the db-devel package.

2. make

The makefile will automatically build a config.mk file which
contains definitions of libraries that may or may not be available
on the system such as: ATM, ELF, MNL, and SELINUX.

3. To make documentation, cd to doc/ directory , then
   look at start of Makefile and set correct values for
   PAGESIZE=a4		, ie: a4 , letter ...	(string)
   PAGESPERPAGE=2	, ie: 1 , 2 ...		(numeric)
   and make there. It assumes, that latex, dvips and psnup
   are in your path.

4. This package includes matching sanitized kernel headers because
   the build environment may not have up to date versions. See Makefile
   if you have special requirements and need to point at different
   kernel include files.

Stephen Hemminger
stephen@networkplumber.org

Alexey Kuznetsov
kuznet@ms2.inr.ac.ru