Hacker News new | ask | show | jobs
by niekze 976 days ago
"You should set your PC value equal to your peak TPS divided by the execution time. For example, if you have a peak of 50 TPS and your execution time is half a second, the most effective PC value would be 25."

This confused me. Wouldn't 50 / 0.5 be 100?

1 comments

I did not think it that way, I understand why it is confusing. Think of it this way you have 50 invocations every second, and you take half a second to process each one. Which means at any given time, on average you will have 25 instances of your lambda running. Which means if you set your PC to 25, you pretty much guarantee that every invocation is warm.

Remember that PC is nothing but total number of lambda instances that AWS keeps warm and ready to go.

If you had 50 invocations every second and your execution time was 2 seconds, would you set it to 100? If that's the case, you would multiply the invocations per second by the process time.
Yes, maybe that’s a better way to put it