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

Adding pprof flag to support better tracing & rewriting file watching #97

Merged
merged 6 commits into from
Aug 12, 2024

Conversation

maxpert
Copy link
Owner

@maxpert maxpert commented Dec 29, 2023

Turns out people were noticing high CPU usage due to fsnotify flooding Marmot with fsnotify.Chmod. This PR introduces pprof flag to run marmot with profiling and fixes the issue.

@gedw99
Copy link

gedw99 commented Jun 21, 2024

Hey @maxpert

How do you feel about merging this.

Will be useful for debugging.


for {
changeLogTicker.Reset()

err := conn.WithReadTx(func(_tx *sql.Tx) error {
select {
case ev, ok := <-watcher.Events:
case ev, ok := <-dbChanged:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point of adding another channel and doing the same thing that we are doing in the body of the function. This one new channel + go routine might not be a big deal, but unless there is sophisticated logic adding such additional go routines and channels is just gonna keep on increasing memory overhead.

marmot.go Show resolved Hide resolved
@maxpert maxpert merged commit fe252af into master Aug 12, 2024
10 checks passed
@maxpert maxpert deleted the pprof branch August 12, 2024 16:41
@gedw99
Copy link

gedw99 commented Aug 13, 2024

thanks @maxpert for this. It will make it much easier to work on.

I will try out running Pocket base with a NATS Cluster and see if I can help with optimisation.

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.

2 participants