~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/manager.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-10-28 20:35:24 UTC
  • mfrom: (11593.3.124 builderslave-resume)
  • Revision ID: launchpad@pqm.canonical.com-20101028203524-u0rcybr2k980mvaa
[rs=me][ui=None][no-qa] Slow the rate of polling the buildd-manager
        does to reduce the load on the database and cesium (the
        buildmaster host).

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
    """A manager for a single builder."""
104
104
 
105
105
    # The interval between each poll cycle, in seconds.  We'd ideally
106
 
    # like this to be lower but 5 seems a reasonable compromise between
 
106
    # like this to be lower but 15 seems a reasonable compromise between
107
107
    # responsivity and load on the database server, since in each cycle
108
108
    # we can run quite a few queries.
109
 
    SCAN_INTERVAL = 5
 
109
    #
 
110
    # NB. This used to be as low as 5 but as more builders are added to
 
111
    # the farm this rapidly increases the query count, PG load and this
 
112
    # process's load.  It's backed off until we come up with a better
 
113
    # algorithm for polling.
 
114
    SCAN_INTERVAL = 15
110
115
 
111
116
    def __init__(self, builder_name, logger):
112
117
        self.builder_name = builder_name