From owner-freebsd-questions@FreeBSD.ORG Thu Mar 6 11:12:07 2008 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 C0FAC106567D for ; Thu, 6 Mar 2008 11:12:07 +0000 (UTC) (envelope-from ginganutz@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.184]) by mx1.freebsd.org (Postfix) with ESMTP id 779108FC2D for ; Thu, 6 Mar 2008 11:12:07 +0000 (UTC) (envelope-from ginganutz@gmail.com) Received: by rn-out-0910.google.com with SMTP id e11so1067481rng.7 for ; Thu, 06 Mar 2008 03:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=crgAv6OjhN9OeSp3CsxQkq92YAM1ubi0gSss7XB9B7o=; b=qzZ4I/4FqvtC1boTEPZwsgLuAK0jFkdZMwqcO2ttPH8ZSa06qC5ihZbhDSNjlbuI7IwP2Ria4L4DW0s6K+owrw7YpyuIuA7KI9ICYjxOmsH2E6/OghsUlZIa02vIMw7eJ8f1Gk0YasyQHcossaGwcpFk3q/hO8KzpPhz/YZSzag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nvzTehsCW+iiQ4SZiHs/HgWUnQNbzCzGlr3sFOz2ZbU1+KISJqi9zJzG0jAkaAl37iElxl5fRlLPEOb2kW9DXpkJMHXZ5UUJc2krjklw8YyIZoehJWS6lLWYo0VxuC+Jo6pu3lo49o7batmBnh9mrqGDpebAr876OghI9ah4B4w= Received: by 10.114.53.1 with SMTP id b1mr6551740waa.134.1204801925495; Thu, 06 Mar 2008 03:12:05 -0800 (PST) Received: by 10.114.130.13 with HTTP; Thu, 6 Mar 2008 03:12:05 -0800 (PST) Message-ID: <101567640803060312x70992ef3k85de3acebc5e39be@mail.gmail.com> Date: Thu, 6 Mar 2008 11:12:05 +0000 From: "Simon Street" To: freebsd-questions@freebsd.org In-Reply-To: <200803051814.49944.fbsd.questions@rachie.is-a-geek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <101567640802270431h69e443c9n63090e4b260f3a7b@mail.gmail.com> <101567640803050811r23c74a2fn58d899f758ad246c@mail.gmail.com> <200803051750.46332.fbsd.questions@rachie.is-a-geek.net> <200803051814.49944.fbsd.questions@rachie.is-a-geek.net> Subject: Re: FreeBSD 6.2+PHP+700 sites = DNS Issues? 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: Thu, 06 Mar 2008 11:12:07 -0000 On Wed, Mar 5, 2008 at 5:14 PM, Mel wrote: > > On Wednesday 05 March 2008 17:50:45 Mel wrote: > > On Wednesday 05 March 2008 17:11:25 Simon Street wrote: > > > On Wed, Mar 5, 2008 at 2:32 PM, Mel > > > > wrote: > > > > On Wednesday 05 March 2008 12:01:11 Simon Street wrote: > > > > > In addition i've attempted adding: > > > > > > > > > > kern.maxfilesperproc=65536 > > > > > kern.ipc.somaxconn=1024 > > > > > kern.ipc.maxsockbuf=2097152 > > > > > kern.maxprocperuid=9000 > > > > > to sysctl.conf > > > > > > > > > > kern.maxproc=10240 > > > > > kern.maxfiles=65536 > > > > > kern.ipc.nmbclusters=32768 > > > > > kern.ipc.maxsockets=51200 > > > > > to loader.conf > > > > > > > > > > I've also disabled ipv6 in the kernel (can't remember where I saw > > > > > this suggestion) > > > > > > > > > > Post this I've recompiled apache with: > > > > > [root@~]# export CFLAGS="-DFD_SETSIZE=12000" > > > > > [root@~]# export CXX_FLAGS="-DFD_SETSIZE=12000" > > > > > [root@~]# /scripts/easyapache (this is the cPanel script that auto > > > > > regens apache/php/addons) > > > > > > > > > > I'm having a hard time believing that this issue only plagues > > > > > FreeBSD and is unfixable! > > > > > > > > > > Anyone got any ideas on what else I can change? > > > > > > > > Well, you're probably not reaching any CPanel users, so how about > > > > posting the offending script. Companies like to blame others, lawyers > > > > tell them to. > > > > > > > > What is this script doing anyway, that it needs 12000 open file > > > > descriptors? > > > > > > > > -- > > > > Mel > > > > > > > > Problem with today's modular software: they start with the modules > > > > and never get to the software part. > > > > > > The problems php inside apache (700+ sites). Not sure if gmail replied > > > to my original email properly or not! > > > > > > Basically, PHP refuses (instantly) to resolve dns with mod_php, but > > > its fine connecting to an IP with the same piece of fsockopen code. > > > And it will happily resolve the name if its run from the CLI. > > > > > > I've been told by cpanel that this is a FreeBSD bug but I'm having a > > > hard time accepting that. cPanels third line support seem unable to > > > fix it and are telling me to switch to CGI/suphp which the customer > > > isn't happy with due to .htaccess stuff. > > > > > > I'm making an assumption that its a lack of FD's but my attempts to > > > compile stuff with more seems to be failing, or my assumptions are > > > wrong. > > > Code that breaks: > > > $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); // Fails > > > inside apache2.2/mod_php5, works fine with php5cli on same server > > > $fp = fsockopen("208.77.188.166", 80, $errno, $errstr, 30);// Works all > > > round > > > > > > The code fails with: > > > Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: > > > getaddrinfo failed: hostname nor servname provided, or not known in > > > test.php on line 2 > > > But dns is fine on the server. > > > > Doesn't have anything to do with the DNS, I'm still looking how this can > > be, but the error means that no hostname has been given, since php passes > > NULL to servname by default (see main/network.c around line 202). > > So somewhere along the way the hostname passed to the function gets lost. > > Argh, strike that, the same errorcode is used for unresolvable hostnames. I'm > gonna take a guess that the process is chrooted into /usr/local and therefore > cannot access /etc/resolv.conf to know what the nameserver is. > And, something just entered my mind from way way back - I think if you don't > have HostnameLookups enabled, that any attempt to do resolving inside a httpd > child, will fail. > > -- > > > Mel > > Problem with today's modular software: they start with the modules > and never get to the software part. > I've copied resolv.conf to /usr/local/etc and HostnameLookups is already enabled, no joy :( (Have restarted apache also). Thanks for taking a look though!