1

On an Ubuntu VM iotop shows me that some "apache2 -k start" processes are producing a total disk read load of constantly between 4 M/s and 7 M/s even while no requests are being logged.

lsof shows me about 5000 regular files being used by www-data. How can I determine what is causing so much disk IO while there shouldn't be any at all?

17
  • how many vhosts, how many log files? Jul 25, 2017 at 19:54
  • less than 50 vhosts. wouldn't logging produce write load instead of read load? Jul 25, 2017 at 19:57
  • Probably opening them when launching...interesting. Jul 25, 2017 at 19:58
  • 1
    @RuiFRibeiro not more than a few MB (maximum 4MB right now) Jul 25, 2017 at 20:06
  • 1
    strace or such for I/O related system calls might help
    – thrig
    Jul 25, 2017 at 20:17

1 Answer 1

2

Indications of high I/O will likely require a tracing tool to dig into the details of what that I/O is; strace is a common way to do this:

strace -e trace=file -ff -o output -y -p $some_httpd_pid_here
  • -e trace=file traces file related operations (there's other handy specifiers, see the fine manual) though will not show read calls that may be necessary to figure out which file descriptors are being read from; for that -e trace=open,read or instead just trace everything and then grep the output...
  • -ff follows forks, good if CGI or such are being spawned, or if you're instead tracing the httpd master process as it starts.
  • -o output interacts with -ff and produces output or output.* files to be poked at later.
  • -y isn't portable to older versions of strace but does save the trouble of finding out what file descriptor number 42 or whatever referrers to.

(strace can also be horribly slow; see also on Linux sysdig or SystemTap for alternative takes on tracing things or otherwise debugging what the kernel is doing...)

1
  • sysdig is much more flexible. Jul 26, 2017 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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