From owner-freebsd-pf@FreeBSD.ORG Sun Jun 21 12:38:10 2015 Return-Path: Delivered-To: freebsd-pf@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98F5A930 for ; Sun, 21 Jun 2015 12:38:10 +0000 (UTC) (envelope-from ian.freislich@capeaugusta.com) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 344B014E for ; Sun, 21 Jun 2015 12:38:10 +0000 (UTC) (envelope-from ian.freislich@capeaugusta.com) Received: by wicgi11 with SMTP id gi11so52848673wic.0 for ; Sun, 21 Jun 2015 05:38:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :mime-version:content-type:content-id:date:message-id; bh=3a7RJzWkCzmVvRIoHAQrT73CKgH3wIDLdeZBp+s/mUs=; b=YMFdJ07Y+rT8AhFsQW97dHIJOlNFt3QdRUtsxkaWwe8fH8YE7BT08qipst2TTWm1vy 7GK0YT2MH+JI+9nBGtrWdK6o/QLNI6HoFluJgUi6AP/tLJlfl5pCOxu1qPEP3yZgjpwl On64vFs399KFunf+kjs8QtIh5XxjtztEJL6x1pTZG10eLAHBnlfQx/a9uTK0P5PUtYYh WSYloJfcWszibEoFKMQnHhe0ALF20FNrD1S8lwEFaD78/chJvjFfTaAJ2NGkP0l11Pab TTt2YMfkKu/hWKcugsRfWa77CVbBvBQm4PoxHMHLpS44Kuec+ivnI+Yo5fotdPkuDZIn 2oJw== X-Gm-Message-State: ALoCoQmBxukLpaCnYla4tUHdpUlv9pBsy25YLyftzEQ46/jqfHy+d/Tb/aHtKKVzj3AMgWtgtN45 X-Received: by 10.194.176.68 with SMTP id cg4mr42681105wjc.106.1434890288440; Sun, 21 Jun 2015 05:38:08 -0700 (PDT) Received: from clue.co.za ([197.89.156.54]) by mx.google.com with ESMTPSA id 12sm25561541wjw.17.2015.06.21.05.38.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 05:38:07 -0700 (PDT) From: Ian FREISLICH X-Google-Original-From: Ian FREISLICH Received: from localhost ([127.0.0.1] helo=zen) by clue.co.za with esmtp (Exim 4.85 (FreeBSD)) (envelope-from ) id 1Z6eVg-0000yz-Ar; Sun, 21 Jun 2015 08:38:04 -0400 To: Milan Obuch cc: freebsd-pf@freebsd.org Subject: Re: Large scale NAT with PF - some weird problem In-Reply-To: <20150621133236.75a4d86d@zeta.dino.sk> References: <20150621133236.75a4d86d@zeta.dino.sk> <20150620182432.62797ec5@zeta.dino.sk> <20150619091857.304b707b@zeta.dino.sk> <14e119e8fa8.2755.abfb21602af57f30a7457738c46ad3ae@capeaugusta.com> X-Attribution: BOFH MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3779.1434890284.1@zen> Date: Sun, 21 Jun 2015 08:38:04 -0400 Message-Id: X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2015 12:38:10 -0000 Milan Obuch wrote: > On Sun, 21 Jun 2015 07:19:51 -0400 > Ian FREISLICH wrote: > > > Milan Obuch wrote: > > > Ian FREISLICH wrote: > > > > > > > How many NAT states in your table? > > > > > > How can I find out? Is there another statistics collected I can gert > > > out of pfctl? > > > > pfctl -s nat -v > > > > Ian > > > > My nat rule evaluates into 12 nat 'paragraphs' in this listing, > totalling around 19500 states, plus 4 small nat's with one state, plus > 50 binat's with total 1000 states approx. That's not many states. > One observation, on pfctl -vs info output - when src-limit counters > rises to 30 or so, I am getting first messages someone has problem. Is > it only coincidence or is there really some relation to my problem? Perhaps. These are the options I had set. You probably don't want the if-bound one. # Options # ~~~~~~~ set timeout { \ adaptive.start 900000, \ adaptive.end 1800000 \ } set block-policy return set state-policy if-bound set optimization normal set ruleset-optimization basic set limit states 1500000 set limit frags 40000 set limit src-nodes 150000 --- /etc/sysctl.conf --- net.inet.ip.fastforwarding=1 --- I also had some other settings regarding interrupt moderation on the NIC, netisr threads, queue depth and dispatch. I disabled entropy harvesting on interrupts, and the network path. Some of these settings are loader.conf settings, some are runtime sysctls. I still think that if it's possible, you should give 10-STABLE a try. Ian -- Ian Freislich