Discussion of bug #27673 brought light to an important source of inefficiency in the debuginfod protocol for applications that make repeated queries. The basic problem is that each time we nuke and recreate a curl handle, any cached information such as an active keep-alive http connection, or crypto session keys, are thrown away. Each new connection can take time & CPU, bleeding latency. If we retain the curl-easy handles across debuginfod-client calls, rather than creating/destroying them during Every Call, then much of that setup work is eliminated, and anti-DoS web firewall concerns also eased. Some estimates here indicate savings of hundreds of milliseconds per call are available, and even more if DoS penalties are applied. debuginfod would itself be a good client to use this tactic to maintain persistent connections to its federation partners.
commit 6c8b68b0245c8754997b4c4b0ff4ba24974e3fdd Author: Frank Ch. Eigler <fche@redhat.com> Date: Fri Apr 23 13:04:26 2021 -0400 PR27701: debuginfod client: encourage reused debuginfod_client objects