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

PGO for non-terminating programs #27

Closed
flippette opened this issue Dec 1, 2022 · 2 comments
Closed

PGO for non-terminating programs #27

flippette opened this issue Dec 1, 2022 · 2 comments

Comments

@flippette
Copy link

So I have a server that is supposed to run forever. How can I gather instrumentation data for such a program?

@Kobzol
Copy link
Owner

Kobzol commented Dec 1, 2022

Hi :) I think that the easiest way is just to execute your server with PGO, then let it run for some time on a representative workload (e.g. if it was a HTTP server, you can simulate some client load or just let it be used by clients for an hour).

It seems that currently if the PGO instrumented program exits abruptly, the profiles might not be saved. So the safest option is probably to just add some hard limit to your service (like end after N requests or after N minutes) and then gather profiles in this special limited mode.

There are also some other, more sophisticated ways, for example continually profiling the server in production and reoptimizing it regularly, but that's quite complex (example from Google: https://static.googleusercontent.com/media/research.google.com/cs//pubs/archive/36575.pdf).

@Kobzol
Copy link
Owner

Kobzol commented Mar 21, 2023

Closing this as answered. If you have any further questions or requests for cargo pgo in this manner, feel free to re-open.

@Kobzol Kobzol closed this as completed Mar 21, 2023
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

No branches or pull requests

2 participants