Page MenuHomePhabricator

Cache generation of the SSH authentication keyfile for sshd
ClosedPublic

Authored by epriestley on Oct 21 2016, 2:27 PM.

Details

Summary

Ref T11469. This isn't directly related, but has been on my radar for a while: building SSH keyfiles (particular for installs with a lot of keys, like ours) can be fairly slow.

At least one cluster instance is making multiple clone requests per second. While that should probably be rate limited separately, caching this should mitigate the impact of these requests.

This is pretty straightforward to cache since it's exactly the same every time, and only changes when users modify SSH keys (which is rare).

Test Plan
  • Ran bin/auth-ssh, saw authfile generate.
  • Ran it again, saw it read from cache.
  • Changed an SSH key.
  • Ran it again, saw it regenerate.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley updated this revision to Diff 40323.Oct 21 2016, 2:27 PM
epriestley retitled this revision from to Cache generation of the SSH authentication keyfile for sshd.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad accepted this revision.Oct 21 2016, 2:28 PM
chad edited edge metadata.
This revision is now accepted and ready to land.Oct 21 2016, 2:28 PM
epriestley added inline comments.Oct 21 2016, 2:29 PM
src/applications/cache/PhabricatorKeyValueDatabaseCache.php
101

This was just a bug, but we mostly don't interact with database caches today since we have relatively little data like this.

This revision was automatically updated to reflect the committed changes.