mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 16:05:42 +07:00

The current system makes / lets GC run during fetching. This has a few issues: - the autogc consumes resources during the forward-porting process (not that it's hugely urgent but it seems unnecessary) - the autogc commonly fails due to the combination of large repository (odoo/odoo) and low memory limits (hardmem for odoo, which get translated into soft ulimits) As a result, the garbage collection of the repository sometimes stops entirely, leading to an increase in repository size and a decrease in performances. To mitigate this issue, disable the automagic gc and maintenance during normal operation, and instead add a weekly cron which runs an aggressive GC with memory limits disabled (as far as they can get, if the limits are imposed externally there's nothing to be done). The maintenance is implemented using a full lockout of the forward-port cron and an in-place GC rather than a copy/gc/swap, as doing this maintenance at the small hours of the week-end (sat-sun night) seems like a non-issue: currently an aggressive GC of odoo/odoo (using the default aggressive options) takes a total of 2:30 wallclock (5h user) on a fairly elderly machine (it's closer to 20mn wallclock and 2h user on my local machine, also turns out the cache repos are kinda badly configured leading to ~30% more objects than necessary which doesn't help). For the record, a fresh checkout of odoo/odoo right now yields: | Overall repository size | | | * Commits | | | * Count | 199 k | | * Total size | 102 MiB | | * Trees | | | * Count | 1.60 M | | * Total size | 2.67 GiB | | * Total tree entries | 74.1 M | | * Blobs | | | * Count | 1.69 M | | * Total size | 72.4 GiB | If this still proves insufficient, a further option would be to deploy a "generational repacking" strategy: https://gitlab.com/gitlab-org/gitaly/-/issues/2861 (though apparently it's not yet been implemented / deployed on gitlab so...). But for now we'll see how it shakes out. Close #489
59 lines
2.5 KiB
XML
59 lines
2.5 KiB
XML
<odoo>
|
|
<record model="ir.cron" id="port_forward">
|
|
<field name="name">Check if there are merged PRs to port</field>
|
|
<field name="model_id" ref="model_forwardport_batches"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._process()</field>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">minutes</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
|
|
<record model="ir.cron" id="updates">
|
|
<field name="name">Update followup FP PRs</field>
|
|
<field name="model_id" ref="model_forwardport_updates"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._process()</field>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">minutes</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
|
|
<record model="ir.cron" id="reminder">
|
|
<field name="name">Remind open PR</field>
|
|
<field name="model_id" ref="model_runbot_merge_pull_requests"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._reminder()</field>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">days</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
|
|
<record model="ir.cron" id="remover">
|
|
<field name="name">Remove branches of merged PRs</field>
|
|
<field name="model_id" ref="model_forwardport_branch_remover"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._process()</field>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">hours</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
|
|
<record model="ir.cron" id="maintenance">
|
|
<field name="name">Maintenance of repo cache</field>
|
|
<field name="model_id" ref="model_forwardport_maintenance"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._run()</field>
|
|
<!-- run sunday morning as it can take a while, unlikely someone will need to forward-port stuff at that point -->
|
|
<field name="nextcall" eval="datetime.utcnow() + relativedelta(weekday=6, hour=2, minute=0, second=0, microsecond=0)"/>
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">weeks</field>
|
|
<field name="numbercall">-1</field>
|
|
<field name="doall" eval="False"/>
|
|
</record>
|
|
</odoo>
|