-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Feature] Refactor Python agent UUID generation #10849
Comments
Timstamp + rolling increasing number may face conflict in high concurrency cases. Be careful of that. Java agent includes thread ID to avoid that. |
Thanks for reminding! I forgot to mention the threadID, it's also included in the new implementation to sync with Java agent + forking mechanism that is rather frequent in Python. It will be in the form of |
Good to see. I am aware of UUID cost in Java. Good to know the same in Python. |
This issue applies to most agents, including skywalking-go (I think) |
Sure, it looks like a simple version of the snowflake id generator, Am I right? I need to do some performance testing in skywalking-go. |
Yes, it was inspired by that but without coordinator to assign the range. Instead, we tradeoff ID length for a better performance. |
Done on Go and Python side, do other agents need an update? @wu-sheng should i keep this issue open as a reminder. |
It is fine. If people care, they would follow up. Feel free to close once your side is done. |
Okay! |
Search before asking
Description
Refactoring the uuid generator shows a 30% thoroughput increase in small transactions. UUID in Python agent previously was implemented as a ID class that creates a new UUID1 instance every single time when required, a huge number of uuids is added up as a costly bottleneck that consume large portion of CPU time. New method will replicate the Java agent logic and use a global PROCESSID (uuid4) + ThreadID + Timestamp + (1-9999) as the ids plus other python-specific optimizations.
Use case
Reduce performance cost of introducing Python agent.
This probably also leads to a new release along with several smaller enhancements.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: