3 ms·
Lots of users. Anything will be CPU-heavy if you give it enough work. Except the things that end up being memory-bound instead, but the NPM database isn't larg
by Filligree 8y ago
Lots of users. Anything will be CPU-heavy if you give it enough work.
Except the things that end up being memory-bound instead, but the NPM database isn't large enough for that.
- Dylan16807 8y ago> Anything will be CPU-heavy if you give it enough work. Not in a relative sense. If authorization is 5% of the work, scaling it leaves it at 5% of the work, and it's never a bottleneck. Authorization was being a significant bottleneck, not a tiny percent, and that is somewhat surprising.
- andy_ppp 8y agoObviously authorisation will be a huge overhead compared to sendfile + nginx right? Am I misunderstanding what npm does?
- Dylan16807 8y agoI mean, to use sendfile you need to open the file, and that does a permission check too...
- andy_ppp 8y agoNo I'm talking about private NPM right. The perms on the file system are not equal to (or as costly as) the auth I need to have to access my private NPM repo.
- yawaramin 8y agoCouldn't you implement the authorization logic in, say, Redis? Then the npm service is I/O-bound again, and everyone is doing the job they're optimized for.
- Filligree 8y agoAuthorization checks aren't that expensive. The overhead of using an external service might well make it take up more hardware overall.