Groups
Groups
Sign in
Groups
Groups
openresty
Conversations
Labels
About
Send feedback
Help
请教大神们在项目中都使用哪些mvc框架
138 views
lua
openresty
Skip to first unread message
唐毅
unread,
Dec 20, 2018, 1:06:21 AM
12/20/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openresty
最近入坑春哥的or,但在选择web框架的时候有点拿不准了,前后对裸写lua,lor和lapis进行了对比(2核2G的虚拟机):
wrk -t8 -c1600 -d1m --latency "
http://localhost:32769/lua
" 进行压测
裸写hello world,Requests/sec:9k 多
lor 简单输出hello world,Requests/sec:8k 多
lapis 做同样输出,Requests/sec只有1k 多
lapis性能掉得很厉害,请教各位老司机是lapis需要做什么特殊配置吗?
ms2008
unread,
Mar 24, 2019, 12:14:12 PM
3/24/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openresty
我这比测试性能差距没有这么大,lapis 默认会关闭 lua_code_cache,并且会刷 access 日志到 error,会对其造成性能影响
我的测试结果是:
lor 会损耗掉原生 50% 的性能,lapis 又会损耗掉 lor 30% 的性能
在 2018年12月20日星期四 UTC+8下午2:06:21,唐毅写道:
Kurapica Wang
unread,
Mar 25, 2019, 11:10:28 AM
3/25/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openresty
测试1次Hello world意义并不大,忽略函数内部消耗,单纯从函数调用次数来看,直接输出hello world仅需要1次,而走框架的话,请求处理,路由匹配,处理函数调用,mvc架构中的对象生成等,都是多次函数调用,业务代码占比太小是没有实际意义的,你可以输出50次hello world,加重业务代码的比例再来比较。
以我自己的框架为例子,写1次hello world,QPS是24000,走mvc框架只有4000,写50次,直接走QPS 5k,而mvc达到了3k5,性能损失已经可以忽略了。
在 2018年12月20日星期四 UTC+8下午2:06:21,唐毅写道:
最近入坑春哥的or,但在选择web框架的时候有点拿不准了,前后对裸写lua,lor和lapis进行了对比(2核2G的虚拟机):
Reply all
Reply to author
Forward
0 new messages