Java 容器化的历史坑(史坑) - 资源限制篇
· ☕ 5 分钟
由来
时间回到 2017 年,老东家要上 Kubernetes 了,有幸参与和学习(主要是学习)。当时遇到的一了所有 Java 容器化者都遇到的坑:JDK8 不为容器化设计综合症。最简单的例子是Runtime.getRuntime().availableProcessors()
返回了主机的 CPU 数,而非期望的容器自身的cpu share/quota
,或说 k8s 的 cpu request/limit
。
寫點文章吧.
时间回到 2017 年,老东家要上 Kubernetes 了,有幸参与和学习(主要是学习)。当时遇到的一了所有 Java 容器化者都遇到的坑:JDK8 不为容器化设计综合症。最简单的例子是Runtime.getRuntime().availableProcessors()
返回了主机的 CPU 数,而非期望的容器自身的cpu share/quota
,或说 k8s 的 cpu request/limit
。
如果说,引入一个技术需要兴趣和冲劲,那么,让这个技术上线需要的是坚持和执着。 Cloud Native 如是, Istio 如是。
在上线前的性能测试中,Istio 的使用提供了可观察性、运维上的便利,同时也引入了痛苦:增加了服务响应延时。如何让痛苦减到最低,成了当下之急。
话说,一年前项目响应时代的号召,引入了 Istio,从此如刘备得卧龙、凤雏,走上了 Service Mesh 的光辉大道。现到准备益州之战(上线)之时。上线前,还得评估一下性能变化。
程序员有两个世界:
It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.
肯尼斯·汤普森(Kenneth Thompson)与丹尼斯·里奇(Dennis Ritchie)一起在AT&T贝尔实验室开发了UNIX。 UNIX操作系统结合了Multics提供的许多分时和文件管理功能,并由此得名。 (Multics是1960年代中期的一个项目,代表了创建多用户,多任务操作系统的第一项努力。)UNIX操作系统迅速赢得了广泛的关注,尤其是在工程师和科学家中。
翻开印象笔记,我回顾了一下最有价值的资料:
Docker/Container 实现原理和架构的入门
J: welcome everyone to another Agent
Gateway community meeting. Um, we have a few items but nothing.
Um, if you have anything else like feel free
to add it. Uh, we can we can go and uh go in order.
Uh, while we’re getting our names in there and some agenda. Yeah, Carlos,
what’s up?
C: No, just like uh as a as a standing thing like just um we can have
|
|
上面程序中,FAISS.from_documents 是什么作用?
https://modelcontextprotocol.io/specification/2024-11-05/basic/transports#http-with-sse
The server MUST provide two endpoints:
双连接,一个SSE,一个POST。 SSE 用于服务器推送,POST用于客户端发送。