Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move invocation logging into a thread pool executor #1049

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

tonybaloney
Copy link
Contributor

This change moves the logging call inside the function invocation callback into a thread pool executor (With a max size of 1).
Effectively allows the logging call to happen concurrently with the function invocation.

In real-terms, with a patched function host, the response times were:

50 66 75 80 90 95 98 99
Original 15 17 18 20 27 42 58 64
Patched 14 16 17 19 26 35 47 57

screenshot 2022-06-01 at 11 37 55

At the 95th percentile an improvement of 7ms per request (18%).

IF the customer is using logging inside their function, we should consider making the thread pool executor available/patched on the logger instance.

@tonybaloney
Copy link
Contributor Author

This should be extended to cover the customer logging function code as well. The Python HTTP function demo spends 70% of its time on line 7

image

@tonybaloney
Copy link
Contributor Author

image
With the threaded logger.

@YunchuWang YunchuWang force-pushed the dev branch 2 times, most recently from 4556193 to b7fbdca Compare March 11, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants