Hi~最近我在做一个中转接口,该中转接口负责把用户请求转发到其它接口(使用ngx.location.capture_multi转发),由于中转接口并发量比较大,导致出现下面错误:
[alert] 51471#0: worker process 59462 exited on signal 11nginx: lua atpanic: Lua VM crashed, reason: not enough memory请问这可能是由于什么原因造成的?另外,下面这两种错误有什么不同?同样是内存不足,什么情况下会导致VM crashed,什么情况下不会?
错误1:lua entry thread aborted: memory allocation error: not enough memory错误2:nginx: lua atpanic: Lua VM crashed, reason: not enough memory我使用的openresty版本是1.2.8.6
--
Hello在 2016年7月21日 上午10:15,梁健峰 <ljf...@gmail.com>写道:Hi~最近我在做一个中转接口,该中转接口负责把用户请求转发到其它接口(使用ngx.location.capture_multi转发),由于中转接口并发量比较大,导致出现下面错误:ngx.location.capture_multi 是全缓冲方式的最好用 cosocket 流式处理,并发的话就用 ngx.thread [alert] 51471#0: worker process 59462 exited on signal 11nginx: lua atpanic: Lua VM crashed, reason: not enough memory请问这可能是由于什么原因造成的?另外,下面这两种错误有什么不同?同样是内存不足,什么情况下会导致VM crashed,什么情况下不会?没有太多区别,这是调用点不太一样 错误1:lua entry thread aborted: memory allocation error: not enough memory错误2:nginx: lua atpanic: Lua VM crashed, reason: not enough memory我使用的openresty版本是1.2.8.6这个,太老了吧或许你应该先升级一下,看看是否是老版本的潜在 bug ? -- --
升级版本吧,我之前用老版本的也碰到这个问题,升级到现在就好了另外,ngx.location.capture_multi可以用线程Thread和resty.http这两个模块组合来实现,效果更好在 2016-07-21 21:59:50,"DeJiang Zhu" <douji...@gmail.com> 写道: Hello在 2016年7月21日 上午10:15,梁健峰 <ljfr...@gmail.com>写道:Hi~最近我在做一个中转接口,该中转接口负责把用户请求转发到其它接口(使用ngx.location.capture_multi转发),由于中转接口并发量比较大,导致出现下面错误:ngx.location.capture_multi 是全缓冲方式的最好用 cosocket 流式处理,并发的话就用 ngx.thread [alert] 51471#0: worker process 59462 exited on signal 11nginx: lua atpanic: Lua VM crashed, reason: not enough memory请问这可能是由于什么原因造成的?另外,下面这两种错误有什么不同?同样是内存不足,什么情况下会导致VM crashed,什么情况下不会?没有太多区别,这是调用点不太一样 错误1:lua entry thread aborted: memory allocation error: not enough memory错误2:nginx: lua atpanic: Lua VM crashed, reason: not enough memory我使用的openresty版本是1.2.8.6这个,太老了吧或许你应该先升级一下,看看是否是老版本的潜在 bug ? -- --
Hello在 2016年7月21日 上午10:15,梁健峰 <ljfr...@gmail.com>写道:Hi~最近我在做一个中转接口,该中转接口负责把用户请求转发到其它接口(使用ngx.location.capture_multi转发),由于中转接口并发量比较大,导致出现下面错误:ngx.location.capture_multi 是全缓冲方式的最好用 cosocket 流式处理,并发的话就用 ngx.thread [alert] 51471#0: worker process 59462 exited on signal 11nginx: lua atpanic: Lua VM crashed, reason: not enough memory请问这可能是由于什么原因造成的?另外,下面这两种错误有什么不同?同样是内存不足,什么情况下会导致VM crashed,什么情况下不会?没有太多区别,这是调用点不太一样 错误1:lua entry thread aborted: memory allocation error: not enough memory错误2:nginx: lua atpanic: Lua VM crashed, reason: not enough memory我使用的openresty版本是1.2.8.6这个,太老了吧或许你应该先升级一下,看看是否是老版本的潜在 bug ? -- --
Use a mix of linear probing and pseudo-random probing. Workaround for 1GB MAP_32BIT limit on Linux/x64. Now 2GB with !LJ_GC64. Enforce 128TB LJ_GC64 limit for > 47 bit memory layouts (ARM64).
MAP_32BIT
!LJ_GC64
LJ_GC64
我升级到1.9.3.2版本之后,确实没再报lua VM崩溃的错误了,感谢你的帮助:)在 2016年7月22日星期五 UTC+8上午10:17:59,xiongyunkun写道:升级版本吧,我之前用老版本的也碰到这个问题,升级到现在就好了另外,ngx.location.capture_multi可以用线程Thread和resty.http这两个模块组合来实现,效果更好在 2016-07-21 21:59:50,"DeJiang Zhu" <douji...@gmail.com> 写道: Hello在 2016年7月21日 上午10:15,梁健峰 <ljfr...@gmail.com>写道:Hi~最近我在做一个中转接口,该中转接口负责把用户请求转发到其它接口(使用ngx.location.capture_multi转发),由于中转接口并发量比较大,导致出现下面错误:ngx.location.capture_multi 是全缓冲方式的最好用 cosocket 流式处理,并发的话就用 ngx.thread [alert] 51471#0: worker process 59462 exited on signal 11nginx: lua atpanic: Lua VM crashed, reason: not enough memory请问这可能是由于什么原因造成的?另外,下面这两种错误有什么不同?同样是内存不足,什么情况下会导致VM crashed,什么情况下不会?没有太多区别,这是调用点不太一样 错误1:lua entry thread aborted: memory allocation error: not enough memory错误2:nginx: lua atpanic: Lua VM crashed, reason: not enough memory我使用的openresty版本是1.2.8.6这个,太老了吧或许你应该先升级一下,看看是否是老版本的潜在 bug ? -- --