Custom CPU Profile Settings Now Available in N|Solid for AWS Lambda
N|Solid for AWS Lambda has a new settings page! N|Solid for AWS Lambda users can now set a sample rate to customize how frequently CPU profiles are collected on serverless function executions. You can choose the frequency in which you want to collect the samples in a period of time and the sample probability of the function in percentage.
How does it work?
To minimize monitoring overhead, N|Solid for AWS Lambda samples a subset of all function invocations, instead of sampling every invocation.
The sample rate is determined by sample frequency and sample probability:
Sample frequency: determines the time-intervals in which serverless functions are sampled for a detailed profile. If the sample frequency is set to 10 minutes, N|Solid takes a profile at the beginning of every 10 minute-interval while your function is running. If it runs less often, the sample will be captured on the next invocation following this period.
Sample probability: sets the probability with which a single invocation is sampled for a detailed profile. This is independent of the sample frequency. So, for instance, if your Sample Probability is set to 10%, there is a 10 percent chance that a new function invocation will be sampled. That way, you can ensure that both long- and short-lived functions receive samples independent of how long they live.
For production instances, you might want to choose a lower sample probability to optimize the performance of your serverless application, while for staging or development instances you might lean toward a higher sample frequency and sample probability to help diagnose potential issues before they reach production.
Once adjusted, both sample frequency and sample probability are updated on the function’s next cold start.
Critically, by giving users control over both the sample frequency and the sample probability, we’ve made it easier to control the performance overhead incurred when running N|Solid as a Lambda Layer.