What is `/_ah/background` with Google Flex VM

694 views Asked by At

Started using Google Flex Vms recently and in the logs there are multiple requests to /_ah/background that last ~1 hour each time. The only reference to these I could find is this question which mentions they have to do with background threads but I don't believe that's the case here as:

  • nowhere do we use background threads
  • that API is deprecated and I'm not even sure we can use it
  • we do use processes but they're short-lived (nowhere near an hour) and don't print any log messages

Any ideas?

2

There are 2 answers

5
ozarov On BEST ANSWER

/_ah/background is used in flex for AE API calls that are called outside of an incoming request processing context (like threads, async-io, ...).

Even if you don't do that directly log flushing is still done asynchronously (not part of an income request processing).

This is an implementation details and there is a plan to hide it but still find a way to show (in log, trace,...) information about these API calls.

0
Sahas On

FWIW, I thought sharing this picture will provide little insight on the frequency, (possible performance) impact this /_ah/background creates..

is there any workaround to clear this ?

enter image description here