From owner-freebsd-questions@FreeBSD.ORG Sat Jul 11 18:27:55 2009 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 14ACC106566C for ; Sat, 11 Jul 2009 18:27:55 +0000 (UTC) (envelope-from antonio04@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id 91A298FC13 for ; Sat, 11 Jul 2009 18:27:54 +0000 (UTC) (envelope-from antonio04@gmail.com) Received: by fxm24 with SMTP id 24so1217837fxm.43 for ; Sat, 11 Jul 2009 11:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=PTiCcFpTUR2kWbGahaTgYMi5541gMV/KT0hOGfjudak=; b=hH6srU46q8BroghuRdpkcCle7sJaz/xRnw49l04ePws02WZo1BcCs790HIsPhigfub 62+Om+mSOk0MIsARVTCCY8RIeTHFWLFQ54U5Yvd27wenO5ADh07lN17/8iZbaRUbd+qd gla7qjlbjY1D0YcxG5+ZPYBQoBhNSFLVhgnfM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rQOjqyfbwzHFpUStjq2QkzJTDm+NU566hrkTzsPuq8atmH6rDyOWiScCTsvu6ykSZW oVdGySL9B3zewL7FOhdJyfvDDisSS0KHVvnRQMdeckLpnSeSQs8K8Oq/V4luU+r2fg+H xJpM8t2goOz9hAt69NUT017LAhUuGymxU3yXE= MIME-Version: 1.0 Received: by 10.223.109.19 with SMTP id h19mr1538557fap.20.1247335006378; Sat, 11 Jul 2009 10:56:46 -0700 (PDT) Date: Sat, 11 Jul 2009 10:56:46 -0700 Message-ID: From: "Antonio L." To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Determining file on which process is trying to acquire lock / fbsd 7.1 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: Sat, 11 Jul 2009 18:27:55 -0000 Hello! I have a web server running nginx + php-fpm FreeBSD 7.1-RELEASE. When traffic increases, the load doesn't go up noticeably, but I start getting massive timeouts because the php-cgi processes stop responding. In "top," I see a whole bunch of these php-cgi processes in "lockf" state, so I assume they're blocking while trying to acquire a lock on some file. I tried using truss to see where this is occurring and get a lot of the following: # truss -p 77214 ... poll({10/POLLIN|POLLERR|POLLHUP},1,1000) = 1 (0x1) recvfrom(10,"STORED\r\n",8192,0x80,NULL,0x0) = 8 (0x8) close(10) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) fcntl(4,F_SETLKW,0x7fffffffc580) = 0 (0x0) ... That last line is repeated about 20 times, then the process seems to get the lock and go about its business, and then repeat. There always seems to be a pause in the truss output to my terminal after the "poll({10/POLLIN|POLLERR|POLLHUP},1,1000)" line as well. Is there a way to determine which file the process is trying to set a lock on? Or any other way to troubleshoot the cause of this problem? I tried running "lsof -p 77214," which showed a long list of files used by the process, but I didn't see anything about it trying to get a lock on a file. Googling suggests that "pfiles" on Solaris might help with this -- is there an analogous utility on FreeBSD? Thanks a lot in advance for any advice you might have! Antonio