Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

LoopingCallService sync by default #3661

Merged
merged 4 commits into from
Feb 7, 2020
Merged

Conversation

etam
Copy link
Contributor

@etam etam commented Dec 11, 2018

For these services I think it's OK to let them run in threads:

  • TaskArchiverService
  • ResourceCleanerService

fixes #3660
fixes #3245
resolves #2851
fixes #5083

@etam etam self-assigned this Dec 11, 2018
@ghost ghost added the in progress label Dec 11, 2018
@etam etam changed the title Looping call service sync by default LoopingCallService sync by default Dec 11, 2018
@etam etam force-pushed the LoopingCallService_sync_by_default branch from c066be4 to 02cbc34 Compare December 11, 2018 15:29
@mplebanski
Copy link
Contributor

Why do you think it is safe to run TaskArchiver service in a separate thread? By looking at do_maintenance method it is no so clear to me.

@mplebanski
Copy link
Contributor

Same question for ResourceCleanerService. It is using the same dir_manager that is used by the golem apps arbitrarily.

@etam
Copy link
Contributor Author

etam commented Dec 12, 2018

Why do you think it is safe to run TaskArchiver service in a separate thread? By looking at do_maintenance method it is no so clear to me.

Ok, I had a closer look at it, and it's not thread safe. But very little work is required to make it so, so I'll do it.

@etam
Copy link
Contributor Author

etam commented Dec 12, 2018

Same question for ResourceCleanerService. It is using the same dir_manager that is used by the golem apps arbitrarily.

No, it calls remove_distributed_files and remove_received_files, which are creating their own instances of DirManager and are just removing files from filesystem. There's an issue to make it more safe #2432, but from threading point of view, I see no problem here.

@mplebanski
Copy link
Contributor

Did you have a chance to run it and check performance behavior?

@etam
Copy link
Contributor Author

etam commented Dec 13, 2018

Did you have a chance to run it and check performance behavior?

Yes and it seems that it's working good.

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #3661 into develop will increase coverage by 2.23%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #3661      +/-   ##
===========================================
+ Coverage    87.78%   90.01%   +2.23%     
===========================================
  Files          234      234              
  Lines        22090    22079      -11     
===========================================
+ Hits         19391    19875     +484     
+ Misses        2699     2204     -495

Copy link
Contributor

@mfranciszkiewicz mfranciszkiewicz left a comment

Choose a reason for hiding this comment

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

DoWorkService will now be called every second in the main thread. Please profile it when Golem is under load, since that service used to be a big performance hit.

@etam etam force-pushed the LoopingCallService_sync_by_default branch from 252ea19 to a406e27 Compare January 7, 2019 13:38
@mplebanski
Copy link
Contributor

Are we going to merge that or not?

@etam
Copy link
Contributor Author

etam commented Jan 8, 2019

I'm working on properly profiling golem. It means I need to learn a bit of this stuff. When I'm done I'll share my results and write a guide for others.

@mplebanski
Copy link
Contributor

Awesome.

@etam etam force-pushed the LoopingCallService_sync_by_default branch from a406e27 to 75e94bb Compare February 3, 2020 14:02
@etam
Copy link
Contributor Author

etam commented Feb 3, 2020

The same change, but rebased onto b0.22 is in branch LoopingCallService_sync_by_default_b0.22

@jiivan
Copy link
Contributor

jiivan commented Feb 5, 2020

IMvHO it this change looks promising. Were there any conclusions from profiling/running under load?

@etam
Copy link
Contributor Author

etam commented Feb 5, 2020

I didn't got to testing under serious load (like mainnet network), because I was moved to other tasks back then. Now our QA team is testing this (but without profiling), to check if there are any regressions.

@etam etam merged commit 64eebf2 into develop Feb 7, 2020
@etam etam deleted the LoopingCallService_sync_by_default branch February 7, 2020 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants