Closed Bug 981039 Opened 11 years ago Closed 11 years ago

slaveapi should have a seperate knob for concurrency on buildapi calls alone

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Callek, Assigned: Callek)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached patch concurrent_buildapi (obsolete) — Splinter Review
Buildapi load is one of the largest reasons we've kept slave rebooter and slaveapi's max concurrency low, with this patch we should be able to expand that.
Attachment #8387767 - Flags: review?(bhearsum)
Comment on attachment 8387767 [details] [diff] [review] concurrent_buildapi Review of attachment 8387767 [details] [diff] [review]: ----------------------------------------------------------------- This might be a bit cleaner if you subclass Semaphore to store the old max, but I'm fine with this too - totally up to you. If you take this approach, there's a couple of things to address: ::: slaveapi-server.py @@ +115,5 @@ > + else: > + max_buildapi = config["concurrency"] > + if semaphores["buildapi"] and \ > + max_buildapi != cached_sem_max["buildapi"]: > + semaphores["buildapi"].counter += max_buildapi - cached_sem_max["buildapi"] Have you tested what happens if this becomes negative? Eg: max_buildapi is 5 cached_sem_max["buildapi"] is 10 counter is 2 Counter will get set to -3 -- does the Semaphore handle this correctly? @@ +119,5 @@ > + semaphores["buildapi"].counter += max_buildapi - cached_sem_max["buildapi"] > + elif semaphores["buildapi"]: > + pass # Nothing to do, counter didn't change > + else: > + semaphores["buildapi"] = Semaphore(max_buildapi) I think these 3 blocks get simpler if you check for the semaphore upfront: if "buildapi" not in semaphores: ... else: if max_buildapi != cached_sem_max["buildapi"]: ... ::: slaveapi.ini.sample @@ +21,4 @@ > > [buildapi] > api_url = https://buildapi.pvt.build.mozilla.org/buildapi/ > +; max_concurrent is optional, defaults to [server].concurrency This doesn't seem like a very sensible default if you want to turn up the overall server concurrency by rate limiting buildapi to something smaller. Seems like this should just be required. ::: slaveapi/global_state.py @@ +15,5 @@ > > from .messenger import Messenger > messenger = Messenger() > + > +semaphores = defaultdict(lambda: None) I don't think there's any reason for this to be a defaultdict. You'll never have a case where semaphores["buildapi"] is undefined if you reformat the block from above.
Attachment #8387767 - Flags: review?(bhearsum) → review-
Attached patch [slaveapi] v2Splinter Review
Addresses previous comments and additionally corrects a gevent 1.0 v 0.13 compat issue (caused by looking at docs for 1.0 instead of .13
Assignee: nobody → bugspam.Callek
Attachment #8387767 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8392632 - Flags: review?(bhearsum)
Attached patch [puppet] v1Splinter Review
Here is the puppet patch to adjust the buildapi concurrency knob now, rather than try and remember this when we deploy.
Attachment #8392634 - Flags: review?(bhearsum)
Attachment #8392632 - Flags: review?(bhearsum) → review+
Attachment #8392634 - Flags: review?(bhearsum) → review+
Comment on attachment 8392632 [details] [diff] [review] [slaveapi] v2 $ git push Counting objects: 42, done. Delta compression using up to 4 threads. Compressing objects: 100% (29/29), done. Writing objects: 100% (29/29), 4.22 KiB | 0 bytes/s, done. Total 29 (delta 22), reused 0 (delta 0) To ssh://git.mozilla.org/build/slaveapi.git 1173310..ccce02a master -> master $ git log 1173310..ccce02a commit ccce02ac8aa2bd7a000733a8d1211881d84fd927 Author: Justin Wood <Callek@gmail.com> Date: Tue Mar 25 22:46:10 2014 -0400 Bump slaveapi ver for Bug 921067 commit ce5eb8a162100f825b910a92c43cc7f6cb10d8e5 Author: Justin Wood <Callek@gmail.com> Date: Tue Mar 25 22:44:17 2014 -0400 Bug 921067 - Slaveapi should support panda devices for reboots. r=bhearsum commit 8d13f0e58ce69436973a25ee2209cc09c08cf24a Author: Justin Wood <Callek@gmail.com> Date: Tue Mar 25 22:41:45 2014 -0400 Bug 984721 - Slaveapi should abstract out Machine from Slave. r=bhearsum commit 7b3966fd3b2904a9b51edac38239bba432ac16cc Author: Justin Wood <Callek@gmail.com> Date: Tue Mar 25 22:35:30 2014 -0400 Bug 981039 - slaveapi should have a seperate knob for concurrency on buildapi calls alone. r=bhearsum
Attachment #8392632 - Flags: checked-in+
This actually failed in production :( -- I had to push a bustage fix: To ssh://gitolite3@git.mozilla.org/build/slaveapi.git c57290f..f51fe93 master -> master http://hg.mozilla.org/build/slaveapi/rev/7cab0d7af0da
deployed for real as part of current Slaveapi 1.0.18.1
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: Tools → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: