I was not even able to use apipie-bindings
until after running foreman-rake apipie:cache
(today I discovered that my work zshrc does not have extendedhistory
turned on)
root@theforeman:~# grep foreman-rake .histfile
foreman-rake apipie:cache
root@theforeman:/usr/share/foreman/doc# ls -l
total 492
drwxr-xr-x. 3 foreman foreman 4096 Jun 2 19:48 ./
drwxr-xr-x. 13 root root 4096 Jun 2 19:45 ../
drwxr-xr-x. 35 foreman foreman 4096 Jun 2 19:48 apidoc/
-rw-rw-r--. 1 foreman foreman 278580 Jun 2 19:48 apidoc-onepage.html
-rw-rw-r--. 1 foreman foreman 160137 Jun 2 19:48 apidoc-plain.html
-rw-rw-r--. 1 foreman foreman 35026 Jun 2 19:48 apidoc.html
I have re-run foreman-rake apipie:cache
and repeated my tests with no change in outcome.
I added log output and it showed me that my Client was implemented extremely poorly, leading to excessive requests per host lookup. the commit for the fix is here: https://github.com/neoice/theforeman-apipie-bugreport/commit/5ab3294473b8f96af2db79185d599d77acce2501
in the plain HTTP version, I was getting a list of host names and then fetching details for each host.
in the apipie version, I was getting a list of host names and then searching for the host by walking the output of hosts/index
. it was obvious when I noticed get_all_hosts
and find_host
both used the same .action()
method.
I think the characteristic of this bug results in exponentially worse performance as node count increases (although it's a bit too early in the morning for me to formally examine this hypothesis). I ran my benchmark/apipie.rb
script against a different Foreman instance: 15% increase in node count resulted in 90% increase in runtime.
my implementation change has caused run times to be roughly equivalent with plain HTTP API implementations.
sorry for causing such a commotion!