造了个轮子 LNMP-Oneinstack

2016-04-13 09:33:18 +08:00
 yesono

一晃 2 年多,还记得 2 年前在 V2EX 发的贴,预写更好用的 lnmp : http://v2ex.com/t/87708

通过网友反馈、鞭策,在 lnmp 基础上增加很多功能,如 java 、 hhvm 等,于是有一个新名字: OneinStack

之后用的人越来越多( lnmp : Sart809 fork317 ; OneinStack : Star 172 fork 84 ),反馈很多,吸取很多想法,不断改进,但我是有强迫症的人,希望做到完美,个人想法是有限的,又来 V2EX 取经啦,希望各位大大给点意见或吐槽。。。。。

相关链接:

https://github.com/lj2007331/lnmp

https://github.com/lj2007331/oneinstack

14186 次点击
所在节点    问与答
85 条回复
yesono
2016-04-13 14:16:08 +08:00
@yuewolf 后期会打成 rpm 包
xrui
2016-04-13 14:17:07 +08:00
原来备份网站直接 rsyns ,现在是打包再传,能改回原来的嘛……几个 G 流量就没了
kxjhlele
2016-04-13 14:20:13 +08:00
我更喜欢安装官方的,之后优化参数,感觉自己编译的和官方的没啥区别
tester4
2016-04-13 14:36:18 +08:00
我在用这个呢,挺好用的,想要 PHP7+APCU
yesono
2016-04-13 14:45:38 +08:00
@tester4 php7 建议用内置 opcache ,原汁原味 哈哈
AstroProfundis
2016-04-13 17:40:56 +08:00
下午没事又搞了一遍,和 https://v2ex.com/t/87755 这里几乎完全一样方法
两台 OpenVZ 虚拟机 256MB RAM/256MB vSwap, 4 CPU, Debian Wheezy 64bit 更新到最新
装上 WordPress 3.7.1 英文版并导入主题测试用例
再从同母机的第三台虚机用 ab 抓第二页 ab -n 25000 -c 50 http://hostname/?paged=2

----
首先是源安装,用了 dotdeb 的默认源
PHP 5.4.45-1~dotdeb+7.1 / MySQL 5.6.29 / nginx 1.8.1
除了 nginx 加上了 PHP 支持以外,全部使用默认配置

其 PHP 配置为:
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

结果:
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking x.x.x.167 (be patient)


Server Software: nginx/1.8.1
Server Hostname: x.x.x.167
Server Port: 80

Document Path: /?paged=2
Document Length: 48526 bytes

Concurrency Level: 50
Time taken for tests: 7082.100 seconds
Complete requests: 25000
Failed requests: 0
Total transferred: 1218625000 bytes
HTML transferred: 1213150000 bytes
Requests per second: 3.53 [#/sec] (mean)
Time per request: 14164.201 [ms] (mean)
Time per request: 283.284 [ms] (mean, across all concurrent requests)
Transfer rate: 168.04 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1052 14149 1201.5 13998 19505
Waiting: 154 12951 1037.2 12671 17456
Total: 1054 14149 1201.5 13998 19505

Percentage of the requests served within a certain time (ms)
50% 13998
66% 14600
75% 14957
80% 15202
90% 15765
95% 16223
98% 16772
99% 17149
100% 19505 (longest request)
AstroProfundis
2016-04-13 17:46:26 +08:00
接下来使用楼主的 oneinstack 编译安装,尽量选择了和源安装一样版本的组件
PHP 5.4.45 / MySQL 5.6.29 / nginx 1.9.14
使用自带脚本新建虚拟主机安装 WordPress, 没有做任何性能相关的配置调整

其 PHP 配置为:
pm = dynamic
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 2048
pm.process_idle_timeout = 10s

结果:
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking x.x.x.169 (be patient)


Server Software: nginx
Server Hostname: x.x.x.169
Server Port: 80

Document Path: /?paged=2
Document Length: 48542 bytes

Concurrency Level: 50
Time taken for tests: 6709.842 seconds
Complete requests: 25000
Failed requests: 0
Total transferred: 1218475000 bytes
HTML transferred: 1213550000 bytes
Requests per second: 3.73 [#/sec] (mean)
Time per request: 13419.683 [ms] (mean)
Time per request: 268.394 [ms] (mean, across all concurrent requests)
Transfer rate: 177.34 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1025 13407 1253.2 12827 19857
Waiting: 1024 13407 1253.1 12827 19857
Total: 1027 13407 1253.2 12827 19857

Percentage of the requests served within a certain time (ms)
50% 12827
66% 13784
75% 14249
80% 14535
90% 15274
95% 15782
98% 16355
99% 16821
100% 19857 (longest request)

结果略好于源安装,总时间较短但单个请求消耗的时间分布更散一些,这个结果比较符合我心目中自己编译的效果(没有明显性能优势但应当和集中打包的二进制表现相当或者略好) @vibbow @yesono

以及这次的两个结果明显比两年前的要好(物理机是同一台,而且我还专门找了老版本的 WordPress 来减少变量),说明程序本身的进步也不容忽视

为了排除进程切换的影响,我正在用和脚本配置一样的 php 在源安装的机器上跑第三遍
kenshin912
2016-04-13 18:34:29 +08:00
首先感谢楼主,目前 Oneinstack 用在生产环境上.
我个人使用 Oneinstack 的时候,每次安装都要一个个选择,所以修改了 install.sh 并且删掉了很多不用的东西后重新打包了一下,楼主不会打我吧...
yesono
2016-04-13 18:45:33 +08:00
@kenshin912 O(∩_∩)O 哈哈~ ,可以的。。。
beyoung
2016-04-13 18:56:06 +08:00
可以做几个预设的 环境 常见的组合 一个个选也的确略显麻烦
yesono
2016-04-13 20:02:52 +08:00
@beyoung 后面会打成 rpm 包。
zjxubinbin
2016-04-13 20:28:01 +08:00
特地来感谢楼主~
zhs227
2016-04-13 20:53:54 +08:00
在用,很好用,支持楼主!
zhs227
2016-04-13 20:55:04 +08:00
希望支持通过配置文件 provision 功能,不用交互输入。这样用在自动化环境上实现可复制安装。
DIYgod
2016-04-13 21:50:58 +08:00
赞赞赞,我也在用,感谢~
ivmm
2016-04-13 22:21:14 +08:00
APCU 已经支持 PHP7 了
yesono
2016-04-13 22:23:42 +08:00
@zhs227 后期可以把参数写到一个文件 静默安装,更简单
yesono
2016-04-13 22:34:56 +08:00
@xrui 网站数据内容小于 1G (不包含数据库)会自动生成 tgz 包 大于 1g 压缩可能太消耗系统资源,数据备份是 rsync
daiv
2016-04-13 22:44:18 +08:00
我也用过一次,感觉体验不错。

以后继续用的时候,反馈一下体验。

非常支持。毕竟军哥的 lnmp 更新慢,安装也慢
Daddy
2016-04-13 23:25:55 +08:00
留言感谢一下,一直在用你们的脚本在自己的 VPS 上

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

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

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

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

© 2021 V2EX