Comments (10)
Flamegraph points to pcre_exec
instead of pcre_jit_exec.
from lua-resty-core.
Have you specified the "jo" options string when calling the ngx.re.* API functions?
from lua-resty-core.
"j" is new to me. So, I tried with "jo". I can now see pcre_jit_exec in the flame graphs.
But the ngx-pcrejit is still reporting that none of the regexps were jit compiled.
I still get the same output saying looks like pcre jit is not enabled.
I also verified that the pcre Makefile has the -g flag.
from lua-resty-core.
@rshriram Try enabling the debug logs temporarily in OpenResty and see if the PCRE JIT compilation just fails for some reason.
from lua-resty-core.
@rshriram Just re-compile with --with-debug
and configure error_log logs/error.log debug;
in your nginx.conf
.
BTW, it would be much easier when the official OpenResty deb packages for Ubuntu are ready (which should be out soon). Then you can just install the openresty-debug
package via apt get
and start openresty-debug
to run your OpenResty applications.
from lua-resty-core.
@rshriram Oh, BTW, your ngx-pcrejit
tool reports that it is tracing the /usr/sbin/nginx
process. Is that truly OpenResty's nginx? I know nothing about the openresty-docker image BTW.
from lua-resty-core.
@rshriram Because you are seeing pcre_jit_exec
in the flame graphs, it means that your PCRE JIT compilation already succeeds. Maybe it's just that ngx-pcrejit
does not work with recent versions of PCRE any more. It was created a while ago.
from lua-resty-core.
@rshriram I just tried the latest PCRE 8.39 on my side with OpenResty. And ngx-pcrejit
works properly on the following nginx.conf
snippet:
location ~ '^/t' {
content_by_lua_block {
ngx.say(ngx.re.find(ngx.var.uri, [[\w]], "jo"))
}
}
Running curl localhost:8080/t
twice while the ngx-pcrejit
tool is tracing the only nginx worker yields the following output:
$ ./ngx-pcrejit -p `pgrep -f 'nginx: worker'`
Tracing 97156 (/home/agentzh/git/lua-nginx-module/work/nginx/sbin/nginx)...
Hit Ctrl-C to end.
WARNING: Missing unwind data for a module, rerun with 'stap -d /usr/lib64/libc-2.21.so'
WARNING: Missing unwind data for a module, rerun with 'stap -d /opt/luajit21dbg/lib/libluajit-5.1.so.2.1.0'
^C
ngx_http_regex_exec: 2 of 2 are PCRE JITted.
ngx_http_lua_ngx_re_match_helper: 2 of 2 are PCRE JITted.
All work as expected. You can try your example on your side.
BTW, below is my Linux system's info:
- Linux kernel 4.4.13
- Systemtap translator/driver (version 3.1/0.161, commit release-3.0-104-gbedfbdce0989 + changes)
- Fedora release 22 (Twenty Two)
from lua-resty-core.
@rshriram BTW, such things should go to the nginx-systemtap-tookit
project instead.
from lua-resty-core.
This is weird.. Granted, I have an older kernel (3.16). But I don't understand why things are not working on Ubuntu 14.04. May be its related to this bug in Launchpad where someone reported that PCRE jit was not really enabled. https://bugs.launchpad.net/ubuntu/+source/pcre3/+bug/1285097
I don't think it applies in this case because PCRE is statically compiled into the app. Will investigate more.
Thanks!
from lua-resty-core.
Related Issues (20)
- no ssl session caching happen, always new session ID!
- 0.1.24 tag missing features from lua-nginx-module 0.10.22
- I want to get all the extension information of client hello, not just server name , what can I do? HOT 6
- b64.encode_base64url problem HOT 3
- undocumented that errlog.set_filter_level can not be set lower than error_log level HOT 1
- ngx.sleep() does not work in ssl_client_hello_by_lua* HOT 13
- undefined symbol: ngx_http_lua_ffi_var_get HOT 3
- ngx.balancer 如何设置重试状态码 HOT 3
- why the lua version number is commented out in Makefile HOT 4
- nginx: [alert] failed to load the 'resty.core' module (https://github.com/openresty/lua-resty-core); ensure you are using an OpenResty release from https://openresty.org/en/download.html (reason: module 'resty.core' not found: HOT 5
- ngx.shared.DICT:ttl() returns 0 for the exipred key
- Requesting information about security fixes. HOT 1
- runtime error: /usr/local/openresty/lualib/ngx/semaphore.lua:129: attempt to perform arithmetic on a nil value HOT 1
- get_client_hello_ext() | lua-resty-core/lib/ngx/ssl | Issue with custom TLS Extension Type 17516
- The feature set_upstream_tls is marked as being introduced in version 0.1.29 HOT 1
- when using ngx.exit(5**), the ngx.ctx is empty at the log_by_lua_block phase
- firefox v128 returning image instead of response 302`
- FreeNginx 1.27.2 - resty.shell Module Load Failure and HAVE_SOCKET_CLOEXEC_PATCH Issue
- stable version? HOT 1
- failed to load the 'resty.core' module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-resty-core.