<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.pre
        {mso-style-name:pre;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1182744733;
        mso-list-template-ids:142254404;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1
        {mso-list-id:1384868791;
        mso-list-template-ids:1130295160;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style></head><body lang="EN-US" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal">                Hoping to follow up on my own questions, I attempted to take advantage of the cProfile functionality[3] against a new run of my cleanup script (profiling was enabled within the Apache/Pulp container to get data on the server side).  This run had an even more isolated run-time data set, with only a single invocation of each of the “unassociate”, “orphans”, and “publish” operations (clocking in at 15.22, 10.28, and 60.59 seconds each, respectively), and I did in fact end up with cProfile data for each of these 3 tasks.  This is a very nice feature, and I’ll bet that data would be really useful to someone who is much more familiar with Pulp than I… but as yet I haven’t yet managed to make much use out of it or appreciate how it is impacted by my specific repository configurations.</p><p class="MsoNormal">                Still looking forward to some insights from the experts.</p><p class="MsoNormal"> </p><p class="MsoNormal">[3] <a href="https://docs.pulpproject.org/dev-guide/debugging.html">https://docs.pulpproject.org/dev-guide/debugging.html</a></p><p class="MsoNormal"> </p><div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b>From:</b> Deej Howard [mailto:<a href="mailto:Deej.Howard@neulion.com">Deej.Howard@neulion.com</a>] <br><b>Sent:</b> Friday, December 15, 2017 10:44 AM<br><b>To:</b> pulp-list <<a href="mailto:pulp-list@redhat.com">pulp-list@redhat.com</a>><br><b>Cc:</b> <a href="mailto:deej.howard@neulion.com">deej.howard@neulion.com</a><br><b>Subject:</b> REST API performance-related question(s)</p></div></div><p class="MsoNormal"> </p><p class="MsoNormal">                Hi, I’m using the 2.14.3 release in a Docker-based configuration (details below), and I’ve noticed some performance-related issues in a script-based artifact cleanup job that is run on a daily basis.  The artifacts in question are of our own construction, incorporated via the Pulp plugin mechanism, and all residing in a single repository (there are around 22K artifacts in that one repo at this point).  The Python script makes various Pulp REST API calls, and I’ve put in some extra code to give me feedback on how much time each call is taking.  The “query” calls have acceptable performance (less than a second, typically), but there are others that are much slower;  calls to “unassociate” and “orphans” take somewhere around 10s, and calls to “publish” take around 45s.</p><p class="MsoNormal">                I’m looking for some guidance on how I can improve this performance.  I’m not the original author of this code, but I was lucky(?) enough to inherit it.  The core algorithm essentially does some queries to get the essential “keys” for the artifacts in question, then calls “unassociate” with the relevant JSON payload for those artifacts, followed by “orphans” to do the actual clean-up action, then “publish” after that completes.  This cycle of action is executed potentially multiple times within the cleanup script (on a “grouped artifact” basis).</p><p class="MsoNormal">                Some specific questions I have:</p><ul style="margin-top:0in" type="disc"><li class="MsoNormal" style="margin-left:0in">Is the methodology outline above appropriate for removing artifacts from a repository, or would some other mechanism be better/more efficient?</li><li class="MsoNormal" style="margin-left:0in">In the documentation for implementing support for new types[1], there is mention of a type definition JSON file that belongs in <span class="pre"><span style="font-size:10.0pt;font-family:"Courier New"">/usr/lib/pulp/plugins/types</span></span>[2]. Unfortunately, it’s not clear which of the Pulp components (Qpid?  MongoDB?  Resource manager?  Workers?) use that information, and it looks like our installation has no files at all in that directory location.  We have other repo types installed (puppet, python), so I would have expected at least one such file, especially given that the puppet_module is provided as the example in the documentation.   This sounds like it could provide improvements to performance via insertion of search indexes or other such shortcuts.  Where can I find more details about this and/or more extensive examples?</li></ul><p class="MsoNormal"> </p><p class="MsoNormal">[1] <a href="https://docs.pulpproject.org/dev-guide/newtypesupport/plugin/example.html">https://docs.pulpproject.org/dev-guide/newtypesupport/plugin/example.html</a></p><p class="MsoNormal">[2] <a href="https://docs.pulpproject.org/dev-guide/newtypesupport/plugin/type_defs.html">https://docs.pulpproject.org/dev-guide/newtypesupport/plugin/type_defs.html</a></p><p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Environment Details</p><ul style="margin-top:0in" type="disc"><li class="MsoNormal" style="margin-left:0in">Pulp 2.14.3 using Docker containers based on Centos 7: one Apache/Pulp API container, one Qpid message broker container, one Mongo DB container, one Celery worker management container, one resource manager/task assignment container, and two Pulp worker containers.  All containers are running within a single Docker host, dedicated to only Pulp-related operations.  The diagram at <a href="http://docs.pulpproject.org/en/2.14/user-guide/scaling.html" target="_blank">http://docs.pulpproject.org/en/2.14/user-guide/scaling.html</a> was used as a guide for this setup.</li><li class="MsoNormal" style="margin-left:0in">Artifacts are company-proprietary (configured as a Pulp plugin), but essentially are a single ZIP file with attached metadata for tracking and management purposes.</li></ul></div></body></html>