Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 66542 invoked from network); 19 Nov 2010 13:39:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Nov 2010 13:39:54 -0000 Received: (qmail 89801 invoked by uid 500); 19 Nov 2010 13:40:23 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 89567 invoked by uid 500); 19 Nov 2010 13:40:22 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 89554 invoked by uid 99); 19 Nov 2010 13:40:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 13:40:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of i.galic@brainsware.org designates 188.40.115.121 as permitted sender) Received: from [188.40.115.121] (HELO mail.brainsware.org) (188.40.115.121) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Nov 2010 13:40:15 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.brainsware.org (Postfix) with ESMTP id 8BAE41DE34A for ; Fri, 19 Nov 2010 13:39:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at brainsware.org Received: from mail.brainsware.org ([127.0.0.1]) by localhost (mail.brainsware.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BJcuBuckDq+4 for ; Fri, 19 Nov 2010 13:39:50 +0000 (UTC) Received: from mail.brainsware.org (mail.brainsware.org [188.40.115.121]) by mail.brainsware.org (Postfix) with ESMTP id B1C441DE342 for ; Fri, 19 Nov 2010 13:39:50 +0000 (UTC) Date: Fri, 19 Nov 2010 13:39:50 +0000 (UTC) From: =?utf-8?Q?Igor_Gali=C4=87?= To: users@httpd.apache.org Message-ID: <755358410.216.1290173990600.JavaMail.root@iris> In-Reply-To: <1208581270.214.1290173755374.JavaMail.root@iris> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [195.72.132.1] X-Mailer: Zimbra 6.0.5_GA_2213.DEBIAN5_64 (ZimbraWebClient - FF3.0 ([unknown])/6.0.5_GA_2213.DEBIAN5_64) X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] debugging websites running on Apache? ----- "Tomasz Chmielewski" wrote: > How do you debug websites running on Apache? >=20 > Say, you have a website which is dog slow on the powerful server. If your website is static, and is dog slow although running on a powerful server, you're doing it wrong. Check http://wiki.apache.org/httpd/PerformanceScalingUp =20 > My favourite way (after checking the obvious errors from the logs) was >=20 > to simply run Apache through strace, which would print where httpd=20 > processes connect to (and possibly hang, while waiting for a=20 > connection), what SQL queries they do, what files they try to open,=20 > where they write to etc. If it's dynamic and is dog slow, it's usually because of the web application (I prefer to call it application, not site in this case so you can easily distinguish it.) What you want is a profiler for your environment. With PHP you have for instance: Xdebug: http://www.xdebug.org/docs/profiler For mod_perl there's Apache::DProf http://search.cpan.org/~fwiles/Apache-DB-0.14/ (but I have no experience with it) > This is great as it lets you see pretty everything which happens on > the=20 > system, but has one major drawback: if anyone but you is using the=20 > webserver, you'll get a lot of noise in strace output - so debugging=20 > with strace is really only useful if you're the only user, which > doesn't=20 > make it a great debugging tool on a busy webserver. >=20 >=20 > What are other debugging methods which can be used on a busy > webserver?=20 > Ideally, I'd like to see all connections, database queries, files > opened=20 > for read/write by Apache processes, with timestamps, as I connect from > a=20 > given IP address (so all other noise is excluded). Even with strace you can reduce the amount of syscalls you see. Check strace(1) for the -e option. If you're on a modern Operating System, you'll have something like DTrace or SystemTap in place, which is a big plus, as it ads almost no overhead to your actions, and could be considered monitoring. If you're on a DTrace aware platform, there's mod_dtrace! (I haven't looked into porting mod_dtrace such that it will work with SystemTap, but it shouldn't be too hard.) > --=20 > Tomasz Chmielewski > http://wpkg.org i --=20 Igor Gali=C4=87 Tel: +43 (0) 664 886 22 883 Mail: i.galic@brainsware.org URL: http://brainsware.org/ --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org