Re: Listen queue overflow

"Davide D'Amico" <[email protected]> Mon, 4 Aug 2014 15:30:09 +0100
Newsgroups gmane.os.freebsd.italian.esperti
Message-ID <CAHykR+L-b+9H5hdEkj8jhWJd2dSk=hQ9xFrCe1jrQX5sj1KrcA@mail.gmail.com>
Mi sembra tutto corretto e per nulla 'sotto stress'; hai provato a dare
un'occhiata a questo articolo:
http://lawrencechen.net/2014/sonewconn-pcb-0xfffffe006acd9310-listen-queue?

d.


Il giorno 04 agosto 2014 15:10, Andrej Sossi <[email protected]> ha
scritto:

> On 04. 08. 2014 15:08, Davide D'Amico wrote:
>
>> Ciao,
>> qualche dettaglio su versione di OS, /boot/loader.conf, /etc/sysctl.conf,
>> banda e connessioni utilizzate, output di netstat -am, statistiche di
>> apache, netstat -an -f inet, netstat -an -f inet6, etc etc ?
>>
>> d.
>>
>>
> Volevo evitare di aggiungere troppe informazioni. Vedo di aggiungere i
> dettagli:
> (Ho sostituito i primi due numeri dell'indirizzo IP del server con un
> YY.ZZ - per evitare attacchi mirati)
>
> root@server-web:~ # uname -a
> FreeBSD server-web.dotcom.ts.it 10.0-RELEASE-p1 FreeBSD 10.0-RELEASE-p1
> #0: Tue Apr  8 06:45:06 UTC 2014 [email protected]:
> /usr/obj/usr/src/sys/GENERIC amd64
> root@server-web:~ # cat /boot/loader.conf
> geom_stripe_load="YES"
> geom_mirror_load="YES"
> if_igb_load="YES"
> ipfw_nat_load="YES"
> root@server-web:~ # cat /etc/sysctl.conf
> # $FreeBSD: release/10.0.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux
> $
> #
> #  This file is read when going to multi-user and its contents piped thru
> #  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
> #
>
> # Uncomment this to prevent users from seeing information about processes
> that
> # are being run under another UID.
> #security.bsd.see_other_uids=0
> net.link.ether.inet.log_arp_movements=0
> net.inet6.ip6.accept_rtadv=0
> net.inet6.ip6.auto_linklocal=0
> root@server-web:~ # ifconfig
> igb0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=400bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_
> MTU,VLAN_HWCSUM,VLAN_HWTSO>
>         ether 0c:c4:7a:01:f0:30
>         inet YY.ZZ.142.98 netmask 0xffffff00 broadcast YY.ZZ.142.255
>         inet6 fe80::ec4:7aff:fe01:f030%igb0 prefixlen 64 scopeid 0x1
>         inet6 2001:41d0:a:4d62::1 prefixlen 64
>         nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
>         media: Ethernet autoselect (1000baseT <full-duplex>)
>         status: active
> igb1: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_
> MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO>
>         ether 0c:c4:7a:01:f0:31
>         nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
>         media: Ethernet autoselect
>         status: no carrier
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
>         inet 127.0.0.1 netmask 0xff000000
>         nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
> lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
>         options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
>         inet 192.168.250.254 netmask 0xffffff00
>         inet 192.168.250.200 netmask 0xffffffff
>         inet 192.168.250.201 netmask 0xffffffff
>         inet 192.168.250.202 netmask 0xffffffff
>         nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
> root@server-web:~ # netstat -am
> 8186/3994/12180 mbufs in use (current/cache/total)
> 8184/1588/9772/4080572 mbuf clusters in use (current/cache/total/max)
> 8184/1587 mbuf+clusters out of packet secondary zone in use (current/cache)
> 0/979/979/2040286 4k (page size) jumbo clusters in use
> (current/cache/total/max)
> 0/0/0/604529 9k jumbo clusters in use (current/cache/total/max)
> 0/0/0/340047 16k jumbo clusters in use (current/cache/total/max)
> 18414K/8090K/26505K bytes allocated to network (current/cache/total)
> 283/8816/271 requests for mbufs denied (mbufs/clusters/mbuf+clusters)
> 0/0/0 requests for mbufs delayed (mbufs/clusters/mbuf+clusters)
> 0/0/0 requests for jumbo clusters delayed (4k/9k/16k)
> 801/0/0 requests for jumbo clusters denied (4k/9k/16k)
> 0 requests for sfbufs denied
> 0 requests for sfbufs delayed
> 0 requests for I/O initiated by sendfile
> root@server-web:~ # netstat -an -f inet
> Active Internet connections (including servers)
> Proto Recv-Q Send-Q Local Address          Foreign Address (state)
> tcp4       0      0 YY.ZZ.142.98.80       81.191.139.114.27331 ESTABLISHED
> tcp4       0      0 192.168.250.200.29269  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.52599
> ESTABLISHED
> tcp4       0      0 192.168.250.200.52599  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       81.191.139.114.64194 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       81.191.139.114.64193 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       213.128.187.35.38467 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       213.128.187.35.17931 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       85.164.110.187.55099 FIN_WAIT_2
> tcp4       0      0 YY.ZZ.142.98.80       85.164.110.187.55098 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.15031  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.51849
> ESTABLISHED
> tcp4       0      0 192.168.250.200.51849  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       85.164.110.187.55097 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.37557  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.32420
> ESTABLISHED
> tcp4       0      0 192.168.250.200.32420  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 192.168.250.200.54064  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.27078
> ESTABLISHED
> tcp4       0      0 192.168.250.200.27078  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 YY.ZZ.142.98.80       95.226.170.196.55426 TIME_WAIT
> tcp4       0      0 192.168.250.200.60684  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.200.31248  192.168.250.201.3306 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.41061 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.41061  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.47508 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.47508  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 YY.ZZ.142.98.80       178.154.202.251.41117 FIN_WAIT_2
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.51223 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.51223  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.28989
> ESTABLISHED
> tcp4       0      0 192.168.250.200.28989  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.62303
> ESTABLISHED
> tcp4       0      0 192.168.250.200.62303  192.168.250.202.6379 ESTABLISHED
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.11928 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.11928  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.10221 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.26074 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.33445 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.15047 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.15047  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.29354 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.29354  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.58582 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.58582  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.50848 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.50848  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.62482 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.62482  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.12556 TIME_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.65091 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.65091  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.40148 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.40148  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.62817 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.62817  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.17591 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.17591  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0      0 YY.ZZ.142.98.80       138.62.0.21.63383 FIN_WAIT_2
> tcp4       0      0 YY.ZZ.142.98.80       151.70.104.47.54897 FIN_WAIT_2
> tcp4       0      0 YY.ZZ.142.98.80       151.70.104.47.54896 FIN_WAIT_2
> tcp4       0      0 192.168.250.202.6379   192.168.250.200.33840 FIN_WAIT_2
> tcp4       0      0 192.168.250.200.33840  192.168.250.202.6379 CLOSE_WAIT
> tcp4       0     52 YY.ZZ.142.98.22       89.96.242.206.48081 ESTABLISHED
> tcp4       0      0 192.168.250.202.22     *.* LISTEN
> tcp4       0      0 192.168.250.202.6379   *.* LISTEN
> tcp4       0      0 192.168.250.201.22     *.* LISTEN
> tcp4       0      0 192.168.250.201.3306   *.* LISTEN
> tcp4       0      0 192.168.250.200.25     *.* LISTEN
> tcp4       0      0 192.168.250.200.80     *.* LISTEN
> tcp4       0      0 192.168.250.200.22     *.* LISTEN
> tcp4       0      0 127.0.0.1.25           *.* LISTEN
> tcp4       0      0 YY.ZZ.142.98.22       *.* LISTEN
> tcp4       0      0 YY.ZZ.142.98.873      *.* LISTEN
> tcp4       0      0 127.0.0.1.53           *.* LISTEN
> udp4       0      0 192.168.250.202.514    *.*
> udp4       0      0 192.168.250.201.514    *.*
> udp4       0      0 192.168.250.200.514    *.*
> udp4       0      0 *.514                  *.*
> udp4       0      0 127.0.0.1.53           *.*
> root@server-web:~ # netstat -an -f inet6
> Active Internet connections (including servers)
> Proto Recv-Q Send-Q Local Address          Foreign Address (state)
> tcp6       0      0 ::1.53                 *.* LISTEN
> udp6       0      0 *.514                  *.*
> udp6       0      0 ::1.53                 *.*
>
>
> Altri dettagli:
> Nel server sono avviati 3 jail in uno è avviato apache httpd
> (192.168.250.200), nel secondo mysql (192.168.250.201) e nel terzo redis -
> DB NoSQL (192.168.250.202). Le richieste dall'esterno vengono girate
> tramite ipfw ad httpd:
> fwd 192.168.250.200,80 tcp from any to me dst-port 80 via igb0
> L'IPv6 è attivo, ma di fatto non utilizzato. Ho dovuto anche aggiungere
> -tso4 -tso6 nella configurazione della scheda di rete per risolvere dei
> problemi di connettività tra le jail e la rete esterna.
>
> Spero sia tutto.
>
>
>
>> Il giorno 04 agosto 2014 13:39, Andrej Sossi <[email protected]
>> <mailto:[email protected]>> ha scritto:
>>
>>
>>     Salve a tutti.
>>     Visto che mi sono appena iscritto colgo l'occasione per salutare
>>     tutti. Volevo avvicinarmi già parecchi anni fa, ma vista
>>     l'attività nulla del sito pensavo che l'organizzazione era di
>>     fatto cessata. Alcuni mesi fa però un "troll" mi ha invitato ad
>>     iscrivermi ed eccomi qua.
>>     Andando sul sodo mi ritrovo con un fastidioso log su un server che
>>     non so come affrontare:
>>
>>     +++ /tmp/security.NMPAk1rv      2014-08-04 03:01:04.000000000 +0200
>>     +sonewconn: pcb 0xfffff8013ade6310: Listen queue overflow: 193
>>     already in queue awaiting acceptance
>>
>>     Il messaggio mi viene ripetuto parecchie volte. Da quello che ho
>>     capito si tratta di un problema che ci sono troppe richieste di
>>     rete al server e l'applicativo non le gestisce e la coda del
>>     sistema operativo è piena...
>>     Il server in questione è un web server e l'unico servizio esposto
>>     al pubblico è l'Apache httpd24. Ho provato a lavorare sia sulla
>>     configurazione di httpd che sui parametri del kernel, come
>>     consigliato su alcuni forum, ma niente, dopo alcuni giorni il
>>     messaggio compare nuovamente identico al precedente.
>>     Dato che le risorse del server sono più che sufficienti vorrei
>>     riuscire a gestire un numerò più elevato di richieste.
>>     Ringrazio anticipatamente per qualsiasi consiglio.
>>
>>     --     Cordiali saluti
>>     Sossi Andrej
>>     -------------------------
>>     DOTCOM Information technology
>>
>>     Via Trento, 16
>>     34132 - Trieste (TS)
>>     Italy
>>
>>     tel: +39 040 9828090 <tel:%2B39%20040%209828090>
>>     fax: +39 040 0641954 <tel:%2B39%20040%200641954>
>>     E-mail: [email protected] <mailto:[email protected]>
>>
>>     ----------------------------
>>
>>     Ai sensi del D.lgs n. 196 del 30.06.03 (Codice Privacy) si precisa
>>     che le informazioni contenute in questo messaggio sono riservate e
>>     ad uso esclusivo del destinatario. Qualora il messaggio in parola
>>     Le fosse pervenuto per errore, La preghiamo di eliminarlo senza
>>     copiarlo e di non inoltrarlo a terzi, dandocene gentilmente
>>     comunicazione. Grazie
>>
>>     This message, for the D.lgs n. 196 / 30.06.03 (Privacy Code), may
>>     contain confidential and/or privileged information. If you are not
>>     the addressee or authorized to receive this for the addressee, you
>>     must not use, copy, disclose or take any action based on this
>>     message or any information herein. If you have received this
>>     message in error, please advise the sender immediately by reply
>>     e-mail and delete this message. Thank you for your cooperation.
>>
>>
>>     _______________________________________________
>>     Esperti mailing list
>>     [email protected] <mailto:[email protected]>
>>
>>     http://mailman.gufi.org/mailman/listinfo/esperti
>>
>>
>>
>>
>> --
>> d.
>>
>>
>> _______________________________________________
>> Esperti mailing list
>> [email protected]
>> http://mailman.gufi.org/mailman/listinfo/esperti
>>
>
>
> --
> Cordiali saluti
> Sossi Andrej
> -------------------------
> DOTCOM Information technology
>
> Via Trento, 16
> 34132 - Trieste (TS)
> Italy
>
> tel: +39 040 9828090
> fax: +39 040 0641954
> E-mail: [email protected]
> ----------------------------
>
> Ai sensi del D.lgs n. 196 del 30.06.03 (Codice Privacy) si precisa che le
> informazioni contenute in questo messaggio sono riservate e ad uso
> esclusivo del destinatario. Qualora il messaggio in parola Le fosse
> pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non
> inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie
>
> This message, for the D.lgs n. 196 / 30.06.03 (Privacy Code), may contain
> confidential and/or privileged information. If you are not the addressee or
> authorized to receive this for the addressee, you must not use, copy,
> disclose or take any action based on this message or any information
> herein. If you have received this message in error, please advise the
> sender immediately by reply e-mail and delete this message. Thank you for
> your cooperation.
>
>
> _______________________________________________
> Esperti mailing list
> [email protected]
> http://mailman.gufi.org/mailman/listinfo/esperti
>



-- 
d.

_______________________________________________
Esperti mailing list
[email protected]
http://mailman.gufi.org/mailman/listinfo/esperti