You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

HHVM/Troubleshooting: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Filippo Giunchedi
imported>Elukey
No edit summary
Line 7: Line 7:
* stacktraces, if available, are in <code>/var/log/hhvm</code>
* stacktraces, if available, are in <code>/var/log/hhvm</code>
* core dumps are in <code>/var/tmp/core</code> or <code>sysctl kernel.core_pattern</code>
* core dumps are in <code>/var/tmp/core</code> or <code>sysctl kernel.core_pattern</code>
== Light process dying ==
HHVM runs requests in different threads but in a single process. fork() has to lock the entire memory space of the process so it can copy it, which blocks all requests that are currently in flight. If HHVM forks in advance, it can just have the child process sitting there, and then when a thread needs to shell out it can just call exec*.
If you see light processes deaths in the logs it could be because they always log when they exit (noisy but ignorable).
There are five pre-forked light processes so that worker threads, serving traffic, don't have to contend for one when they need an additional process forked.
[[Category:MediaWiki production]]

Revision as of 15:59, 5 August 2016

Problem determination and data collection

  • hhvm-dump-debug: captures a stack trace of HHVM and writes it to stdout and to /tmp/hhvm.$PID.bt. Run hhvm-dump-debug --full to generate a core dump as well.
  • links -dump http://127.0.0.1/server-status -width 80: produce a full Apache status report, showing which requests are currently in flight.
  • furl is a cURL-like tool for FastCGI. You can use it to bypass Apache and request pages directly from HHVM. For example: furl http://en.wikipedia.org/wiki/Main_Page. Requests always go to localhost.
  • curl localhost:9002/dump-apc will dump all the current APC keys to /tmp/apc_dump.
  • stacktraces, if available, are in /var/log/hhvm
  • core dumps are in /var/tmp/core or sysctl kernel.core_pattern

Light process dying

HHVM runs requests in different threads but in a single process. fork() has to lock the entire memory space of the process so it can copy it, which blocks all requests that are currently in flight. If HHVM forks in advance, it can just have the child process sitting there, and then when a thread needs to shell out it can just call exec*.

If you see light processes deaths in the logs it could be because they always log when they exit (noisy but ignorable).

There are five pre-forked light processes so that worker threads, serving traffic, don't have to contend for one when they need an additional process forked.