造了个轮子 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

14483 次点击
所在节点    问与答
85 条回复
swsh007
2016-04-13 23:31:28 +08:00
这个要赞一下。
guonning
2016-04-13 23:31:37 +08:00
在用,很好用
ewBuyVmLZMZE
2016-04-13 23:42:12 +08:00
嗯,加上 OpenResty 了?不枉我在你的 QA 里面留言建议。
zetttt
2016-04-14 01:41:03 +08:00
在用,感谢
LeoSocks
2016-04-14 06:44:58 +08:00
在用,非常不错啊
yesono
2016-04-14 08:31:15 +08:00
@syhily 很多人反馈就加上了
fengtalk
2016-04-14 08:45:51 +08:00
不错!目前使用当中……
AstroProfundis
2016-04-14 10:22:05 +08:00
在把源安装调整成和编译安装一样的 PHP 设置(进程数和 CPU 核数相同)之后,结果变成了源安装比编译安装略好

PHP 配置:
pm = dynamic
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.process_idle_timeout = 10s
pm.max_requests = 2048
rlimit_files = 51200
rlimit_core = 0

结果:
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: 6568.194 seconds
Complete requests: 25000
Failed requests: 0
Total transferred: 1218625000 bytes
HTML transferred: 1213150000 bytes
Requests per second: 3.81 [#/sec] (mean)
Time per request: 13136.388 [ms] (mean)
Time per request: 262.728 [ms] (mean, across all concurrent requests)
Transfer rate: 181.19 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 3
Processing: 1030 13123 514.0 13130 17304
Waiting: 158 12224 499.5 12236 15666
Total: 1033 13123 514.0 13130 17304

Percentage of the requests served within a certain time (ms)
50% 13130
66% 13209
75% 13258
80% 13289
90% 13381
95% 13508
98% 14403
99% 15127
100% 17304 (longest request)

所以目前的结论是: php-fpm 的 max_children 要设置成和 CPU 核心数(逻辑核心 /进程数)相同
yesono
2016-04-14 11:57:50 +08:00
@AstroProfundis 最优值不一定是这个,建议压测得出结果,可参考: https://blog.linuxeye.com/380.html
xrui
2016-04-14 16:56:22 +08:00
@yesono 这样啊。。。辛苦了
tangzhehao
2016-04-14 19:06:53 +08:00
yeho 好~
loser
2016-04-18 00:16:52 +08:00
我试试。。。
loser
2016-04-18 00:57:41 +08:00
Complete!
在 messagebus 服务中读取信息时出错:没有那个文件或目录
在 irqbalance 服务中读取信息时出错:没有那个文件或目录
在 syslog 服务中读取信息时出错:没有那个文件或目录
setenforce: SELinux is disabled
sed :无法读取 /etc/selinux/config :没有那个文件或目录
hostname: 未知的主机
sed: 无法重命名 /etc/sed6Nx5vR :设备或资源忙
error: "Read-only file system" setting key "net.ipv4.ip_forward"
error: "Read-only file system" setting key "net.ipv4.conf.default.rp_filter"
error: "Read-only file system" setting key "net.ipv4.conf.default.accept_source_route"
error: "Read-only file system" setting key "kernel.sysrq"
error: "Read-only file system" setting key "kernel.core_uses_pid"
error: "net.ipv4.tcp_syncookies" is an unknown key
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
error: "Read-only file system" setting key "kernel.msgmnb"
error: "Read-only file system" setting key "kernel.msgmax"
error: "Read-only file system" setting key "kernel.shmmax"
error: "Read-only file system" setting key "kernel.shmall"
error: "Read-only file system" setting key "fs.file-max"
error: "Read-only file system" setting key "fs.inotify.max_user_instances"
error: "net.ipv4.tcp_fin_timeout" is an unknown key
error: "net.ipv4.tcp_tw_reuse" is an unknown key
error: "net.ipv4.tcp_tw_recycle" is an unknown key
error: "Read-only file system" setting key "net.ipv4.ip_local_port_range"
error: "net.ipv4.tcp_max_syn_backlog" is an unknown key
error: "net.ipv4.tcp_max_tw_buckets" is an unknown key
error: "net.ipv4.route.gc_timeout" is an unknown key
error: "net.ipv4.tcp_syn_retries" is an unknown key
error: "net.ipv4.tcp_synack_retries" is an unknown key
error: "Read-only file system" setting key "net.core.somaxconn"
error: "net.core.netdev_max_backlog" is an unknown key
error: "net.ipv4.tcp_timestamps" is an unknown key
error: "net.ipv4.tcp_max_orphans" is an unknown key
sed :无法读取 /etc/sysconfig/i18n :没有那个文件或目录
18 Apr 00:58:20 ntpdate[481]: Can't adjust the time of day: Operation not permitted
grep: /var/spool/cron/root: 没有那个文件或目录
Starting crond: [ OK ]
iptables: Setting chains to policy ACCEPT: filter nat [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: iptable_filter iptable_nat ip[FAILED]lter iptable_nat ip_tables
iptables: Applying firewall rules: [ OK ]





来自网易蜂巢安装测试
yesono
2016-04-18 13:04:43 +08:00
@loser 服务器好像有问题, Read-only file system 。。
ug888168
2016-04-20 09:40:54 +08:00
@loser 你服务器的文件只可读
ibiner
2016-06-18 05:26:51 +08:00
LZ 做的很到位,很好用。不知道 256M 的小 VPS 能 yong
yesono
2016-06-24 11:03:34 +08:00
@ibiner 应该是可以的
lyhiving
2016-12-13 23:01:48 +08:00
@yesono 不知道你有没有看这个回复,我目前在用 oneinstck ,感觉很不错。还是提个建议:
1 、 nginx 编译的时候能不能加上个--with-http_sub_module ,每次都要手动添加,差点就 fork 后再改了。
2 、 php 的升级不要一定是升级,其实我多次用来降级,感觉还是可以的。
yesono
2016-12-20 20:16:14 +08:00
@lyhiving 已经在 options.conf 增加 nginx_modules_options='' 写上即可
bbbbbbbk
2017-04-01 16:28:40 +08:00
非常好用,受益匪浅,感谢

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

https://tanronggui.xyz/t/270625

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

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

© 2021 V2EX