Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We run Apache on a FreeBSD system, it has multple web apps on it (Wordpress, Magento, custom PHP). As the traffic increases, we see more and more httpd processes in status "lockf" (using 'top'). The server load increases until we have to restart Apache.

As I understand this state Apache waits for a file lock. But how can we find out which file(s) are to be locked / cause the bottleneck? Without that information, it seems very hard to tackle the problem.

share|improve this question
up vote 1 down vote accepted

It's an old question, but I'll give it a try ;)

This situation sounds like 'you have a slow drive' - but it's just a feeling without knowing more.

To answer the direct question (finding the used files), do the following: Check if you have lsof installed which lsof, if not installed install it by pkg(_install) (dunno which FreeBSD Version you have).

Then search for your http processes by top or ps and use lsof to see which files are used with lsof -p PROCNUMBER This gives you a table of ALL files/dirs/pipes etc. used by this process.

This can now be examined. Have a look at man lsof, it's very long and has much power.

Without knowing the result of what you find, try to reduce or even disable logging and see if this helps. Using the wrong logging setup and much traffic could kill even big machines. And a last note: If you have a good machine running such setup you described, the BIGGEST problem is drive I/O in many cases. Dual Xeon Superbig-CPU has no meaning if you still have an IDE drive ;)

One final resource which might be interesting:

share|improve this answer
The issue was solved somehow a long time ago, but your approach sounds very reasonable - thx! – Bachi Dec 23 '13 at 9:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.