From owner-freebsd-questions@FreeBSD.ORG Mon Dec 12 22:07:48 2011 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37BFE1065676 for ; Mon, 12 Dec 2011 22:07:48 +0000 (UTC) (envelope-from mage@mage.hu) Received: from grs.hu (grs.hu [195.56.45.60]) by mx1.freebsd.org (Postfix) with ESMTP id F25488FC15 for ; Mon, 12 Dec 2011 22:07:47 +0000 (UTC) Received: from localhost ([127.0.0.1]) by grs.hu with esmtp (Exim 4.76) (envelope-from ) id 1RaE2E-0001BZ-9w for freebsd-questions@FreeBSD.org; Mon, 12 Dec 2011 23:07:46 +0100 Message-ID: <4EE67B31.2080101@mage.hu> Date: Mon, 12 Dec 2011 23:07:45 +0100 From: Mage User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111117 Thunderbird/8.0 MIME-Version: 1.0 To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: connection speed (Rails performance) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2011 22:07:48 -0000 Hello, it is my second attempt to switch from Gentoo to FreeBSD because: - if you google for FreeBSD you get sexy images of girls in red wear (turn safe search off) - I am a bit tired to upgrade my hardened servers - zfs supposed to work better and faster However I'am stuck at the same issue where I gave up half year ago. After setting up Ruby on Rails 3 (with rvm), Apache22 and Postgres, I ran some apache benchmarks and figured out that while FreeBSD wins at slow pages, at faster pages FreeBSD (for me) is way slower than Gentoo. A dynamic page: Gentoo: # ab -n 1000 -c 12 http://randi7/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Requests per second: 169.88 [#/sec] (mean) FreeBSD: # ab -n 1000 -c 12 http://randi7/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Requests per second: 59.31 [#/sec] (mean) A static page: $ echo hello > public/index.html Gentoo: # ab -n 1000 -c 12 http://randi7/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Requests per second: 25047.59 [#/sec] (mean) FreeBSD: # ab -n 1000 -c 12 http://randi7/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Requests per second: 6160.29 [#/sec] (mean) The faster the page is generated the bigger the difference is in requests per seconds. I experienced the very same results half year ago at my first attemp to migrate to FreeBSD. All tests were done with more or less current kernels (both systems). This is a totally fresh install on a different computer. Half year ago I tried all of apache, thin, mongrel, nginx and the outcome was same. I guess it might be something with the connection but I don't know what. Of course all tests were ran on localhosts. How could I improve this? Mage