openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.2k stars 193 forks source link

openresty CPU single core 100% ( profiling luajit table rehash) #207

Closed fairyqb closed 8 months ago

fairyqb commented 9 months ago

./luajit LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/ JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse

image

企业微信截图_20230922105307

11-33-rehash

luajit-rehash.bt.txt

0x7fac49e945a6 : lj_tab_setstr+0x6/0x70 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e93ef8 : lj_tab_resize+0x168/0x2b0 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e94230 : rehashtab+0x1f0/0x240 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e942ee : lj_tab_newkey+0x6e/0x290 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac7d410b02 : 0x7fac7d410b02 1772 0x7fac49e9356d : hashkey+0x6d/0xa0 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e94321 : lj_tab_newkey+0xa1/0x290 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e94605 : lj_tab_setstr+0x65/0x70 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e93ef8 : lj_tab_resize+0x168/0x2b0 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e94230 : rehashtab+0x1f0/0x240 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac49e942ee : lj_tab_newkey+0x6e/0x290 [/usr/local/openresty/luajit/lib/libluajit-5.1.so.2.1.0] 0x7fac7d410b02 : 0x7fac7d410b02 409 .... 0x7fac4996dee0 : longest_match+0x230/0x260 [/usr/lib64/libz.so.1.2.7] 0x7fac4996e6f0 : deflate_slow+0x400/0x590 [/usr/lib64/libz.so.1.2.7] 0x7fac4996f684 : deflate+0x114/0x1120 [/usr/lib64/libz.so.1.2.7] 0x4abf78 : ngx_http_gzip_body_filter+0x368/0xa20 [/usr/local/openresty/nginx/sbin/nginx] 0x4aeee3 : ngx_http_ssi_body_filter+0x1643/0x18d0 [/usr/local/openresty/nginx/sbin/nginx] 0x4b1ad7 : ngx_http_charset_body_filter+0xa17/0xaa0 [/usr/local/openresty/nginx/sbin/nginx] 0x4b35cc : ngx_http_trailers_filter+0x4c/0x190 [/usr/local/openresty/nginx/sbin/nginx] 0x5152f4 : ngx_http_lua_capture_body_filter+0xa4/0xd0 [/usr/local/openresty/nginx/sbin/nginx] 0x523e64 : ngx_http_lua_body_filter+0x2d4/0x380 [/usr/local/openresty/nginx/sbin/nginx] 0x4570b5 : ngx_output_chain+0x865/0x890 [/usr/local/openresty/nginx/sbin/nginx] 0x4b3ee3 : ngx_http_copy_filter+0x33/0x180 [/usr/local/openresty/nginx/sbin/nginx] 0x488dbb : ngx_http_output_filter+0xb/0x30 [/usr/local/openresty/nginx/sbin/nginx] 0x49d3d9 : ngx_http_upstream_output_filter+0x19/0x40 [/usr/local/openresty/nginx/sbin/nginx] 0x4733db : ngx_event_pipe+0x22b/0xbb0 [/usr/local/openresty/nginx/sbin/nginx] 0x49d365 : ngx_http_upstream_process_upstream+0x55/0xb0 [/usr/local/openresty/nginx/sbin/nginx] 0x49c3ab : ngx_http_upstream_handler+0x3b/0x70 [/usr/local/openresty/nginx/sbin/nginx] 0x479717 : ngx_epoll_process_events+0x2a7/0x2c0 [/usr/local/openresty/nginx/sbin/nginx] 0x47128b : ngx_process_events_and_timers+0x6b/0x1a0 [/usr/local/openresty/nginx/sbin/nginx] 0x4778a2 : ngx_worker_process_cycle+0x72/0x170 [/usr/local/openresty/nginx/sbin/nginx] 0x476364 : ngx_spawn_process+0x154/0x4d0 [/usr/local/openresty/nginx/sbin/nginx] 1 0x7fac7d3ecdc7 : 0x7fac7d3ecdc7 1

songzhian commented 8 months ago

@fairyqb How did you solve the same problem? I also encountered the same problem