From 21bf7dbf9a388fdb73e76118eeb8144b51f2481c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 4 Oct 2026 12:58:53 +0100 Subject: Say what an app's tokens cost (017 3b, research 116) Requests to an app that checks tokens go 2.92% slower than to an open one on 64 keep-alive connections, 2.2% of it the head the token makes longer (an open app sent the same head is as slow); hashing every request on a new connection costs 0.91%. 031 measures the three in turns. --- docs/design/017-apps-on-one-host.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'docs/design') diff --git a/docs/design/017-apps-on-one-host.md b/docs/design/017-apps-on-one-host.md index 4fcc1df..fb9cbcd 100644 --- a/docs/design/017-apps-on-one-host.md +++ b/docs/design/017-apps-on-one-host.md @@ -2,7 +2,8 @@ 작성일: 2026-10-01. 상태: 1·2단계와 2b 구현, 검사로 고정하고 쟀다([111](../research/111-apps-on-one-host.md), [112](../research/112-sending-between-apps.md), [113](../research/113-one-sending-loop.md)). 3단계(수명) 구현, 검사로 고정하고 -쟀다([115](../research/115-apps-that-change.md)). 3b(경로의 인증)는 설계 전. +쟀다([115](../research/115-apps-that-change.md)). 3b(경로의 인증) 구현, 검사로 고정하고 쟀다 +([116](../research/116-route-tokens.md)). [외부 리뷰 004](../outside-feedback/feedback-004.md)의 "구현 방향에 대한 평가" 셋째에서 시작한다. 작은 OS의 운영 모델( [007](007-execution-domains.md))을 Pure가 실제로 갖게 하는 단계다. @@ -306,6 +307,13 @@ HTTP로 앱을 더하는 길을 두지 않는 까닭은 인증이다. 그 길은 - **하지 않는 것.** TLS: 호스트는 루프백에서 듣고, 밖으로는 TLS를 하는 앞단(Caddy 같은)이 잇는다. 사용자와 세션: 토큰은 앱을 부르는 쪽(서비스, 웹훅, 앞단)의 것이고, 앱 안의 사용자는 앱의 상태다. +### 3b에서 알게 된 것 + +- **값은 확인이 아니라 머리다.** 토큰을 확인하는 앱의 보기가 2.92% 느렸는데, 확인하지 않는 앱에 같은 머리를 보내도 2.2% + 느렸다. 토큰만큼 길어진 머리를 읽는 값이다. 연결이 마지막 토큰의 다이제스트를 기억해서, 확인은 같은 토큰이면 64바이트를 견주는 + 것뿐이다. 요청마다 새 연결로 매번 해시해도 0.91%다. +- 커밋: Pure `51ff7ea`(토큰), 측정은 그 뒤. + ## 3b의 착수 기준 - **바꿀 결정:** 앱의 경로에 토큰을 요구할지다. 아래를 채우지 못하면 경로의 인증을 앞단에 맡긴다. -- cgit v1.2.3