在 Docker centos 7.8 容器中安装 gitea 和直接使用 gitea 容器,性能有差别吗?

2020-05-20 10:17:01 +08:00
 moxuanyuan
试了,centos 7.8 容器中安装 gitea,页面 500~800ms,直接使用 gitea 容器,才 20ms 。正常吗?
2465 次点击
所在节点    Docker
4 条回复
Vegetable
2020-05-20 10:21:59 +08:00
500 到 800 ?这太低了。目录和数据库挂载配置相同吗?如果你的数据是写入到容器中的,可能影响性能。
If your container generates non-persistent state data, consider using a tmpfs mount to avoid storing the data anywhere permanently, and to increase the container’s performance by avoiding writing into the container’s writable layer.
https://docs.docker.com/storage/tmpfs/
moxuanyuan
2020-05-20 10:24:53 +08:00
@Vegetable #1 数据库都是连到同一个 mysql 容器,数据都是挂同一个磁盘
visonnn
2020-05-20 10:25:43 +08:00
https://github.com/go-gitea/gitea/blob/master/Dockerfile

可以对照一下原官方镜像的 Dockerfile,看官方镜像和你的镜像有什么区别。
moxuanyuan
2020-05-20 10:30:12 +08:00
@moxuanyuan #2 找到原因了,centos 容器中,我安装了 tinetd,做了 3306 端口转发到 mysql 容器,gitea 配置中,数库连直接用 127.0.0.1,而 gitea 容器中是直接用 mysql 容器 ip,在 centos gitea 改为 mysql 容器 ip 则正常

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/673499

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX