OpenResty XRay よくある質問

🔗 What is OpenResty XRay?

🔗 What is OpenResty XRay?

OpenResty XRay is a dynamic tracing product that can analyze various cloud and server applications in real-time. It treats running processes and containers as read-only databases and extracts necessary information to resolve performance issues, anomalies, errors, and security vulnerabilities. OpenResty XRay has a knowledge base, an inference engine, and hundreds of advanced analyzers that can diagnose and narrow down the root causes of deep issues without changing or affecting the target application.

🔗 Who should use OpenResty XRay?

DevOps can use OpenResty XRay to quickly discover any issues or identify the root causes, then forward the discovered issues and generate automatic reports to developers.

Development teams can also use OpenResty XRay to check for any regression issues during daily development or before the release of new software products.

🔗 Can OpenResty XRay analyze applications not running on OpenResty?

Of course! OpenResty XRay is a universal platform that can analyze any software. Well, at least the software you control (such as having access to DWARF debug symbols, source code, etc.).

However, OpenResty XRay currently works best with the OpenResty and Nginx technology stacks. Let us know which open-source software you would like OpenResty XRay to support next!

🔗 Does OpenResty XRay require any changes to my application?

No! OpenResty XRay uses advanced dynamic tracing technology and does not require cooperation from the target application. It is 100% non-intrusive.

  1. We do not require plugins or modules to be added to your application.
  2. We do not need to patch your application's code.
  3. We do not require special compilation or startup options (when compiling C/C++ programs, you do need the -g option to send DWARF data, but this is very standard practice).
  4. We do not inject any code into your application processes.

Using OpenResty XRay analyzers will not harm your application processes or even cause them to crash, as we do not add anything to your processes.

🔗 Is there a personal version available for individual use?

Yes, there is! As long as the personal version is not used for any company, government, or other commercial purposes. However, we usually do not provide SLA for the personal version.

🔗 Installation and Deployment

🔗 How do I deploy and install OpenResty XRay for my application?

You need to install and run the OpenResty XRay agent program on the server with your application or container. The agent program is a standalone daemon that can inspect all applications on the same server. It also acts as a client for the OpenResty XRay web console.

There are several ways to install the OpenResty XRay agent.

  1. Install the RPM or Deb package repository we provide for the respective Linux distribution.
  2. Install a large .tar.gz package containing all the RPM or Deb packages we provide for your Linux distribution.
  3. Install our official Docker or Kubernetes (K8s) container images.

A common mistake is installing the agent in your own container. This will always fail because your container will almost always lack the permissions or filesystem access needed for the agent to inspect other processes and containers.

🔗 Which operating systems do we support?

Ubuntu 24.04 noble, Ubuntu 22.04 Jammy, Ubuntu 20.04 Focal, Ubuntu 18.04 Bionic, Debian 12 Bookworm, Debian 11 Bullseye, Debian 10 Buster, Debian 9 Stretch, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 7, Rocky Linux 9, Rocky Linux 8, AlmaLinux 9, AlmaLinux 8, Cent OS 8, Cent OS 7, Cent OS 6, Fedora 36, Fedora 35, Fedora 34, Fedora 33, Fedora 32, Amazon Linux 2023, Amazon Linux 2, Amazon Linux 1, Alibaba Cloud Linux 3, Alibaba Cloud Linux 2, Tencent Linux 3, Tencent Linux 2, OpenSUSE 15, Kylin 10, Kylin 7, CBL-Mariner 2

Our official Docker or K8s container images can run on any modern Linux distribution that supports containers, as long as the Linux distribution used within the target application containers is on the supported list.

If you want to run the OpenResty XRay agent service natively, we support most mainstream Linux distributions. Please check the latest distribution support list for details.

If you have a new Linux distribution that needs native support, please contact us: info@openresty.com!

In the future, we may also support non-Linux operating systems such as Android, macOS, *BSD, and Microsoft Windows.

🔗 Do I need a very new Linux kernel?

No! We support older kernels, such as the 3.10 kernel of CentOS 7. But we do not support older kernels like the 2.6 kernel of CentOS 6.

🔗 Can I use my own Linux kernel?

Yes! But you need to contact our team so that we can index your kernel in the software package database and thoroughly test its compatibility with our product. We do not yet support automatic indexing of custom or unknown kernels. We may consider adding this support in the future.

🔗 Is self-compiled kernel supported?

Yes, you need to upload the relevant kernel packages. The specific kernel packages required can be referenced on the upload page of the OpenResty XRay Console.

🔗 What applications and programming languages does OpenResty XRay support?

Supported programming languages and runtimes: Python, Java, Rust, Perl, PHP, Erlang, Ruby, Go, LuaJIT, C/C++ Supported servers and proxies: OpenResty, Envoy, Kong, CockroachDB, Nginx,

🔗 Can the OpenResty XRay agent analyze applications running on AWS EKS?

Yes.

🔗 Can I use OpenResty XRay on local virtual machines like VMWare/VirtualBox/KVM/etc.?

Yes! All such full-system virtualization technologies should work out of the box with OpenResty XRay. If not, please report it to us.

Please note that installing our agent inside your own Docker or K8s containers is not supported. But you can always use our official Docker and K8s container images to install the agent.

🔗 Can I run OpenResty XRay on public cloud virtual machines?

Yes! For example, Microsoft Azure, Google Cloud (GCP), Amazon Cloud (AWS), or Digital Ocean. Virtualized cloud servers are fine. Physical machines are not required.

🔗 Does the agent need a C compiler toolchain installed?

No. Unlike those open-source dynamic tracing frameworks like SystemTap or eBPF/BCC, OpenResty XRay does not require any C or C++ compiler toolchain to be installed on the target machine. No gcc, no clang, nothing. Also, it does not require any Linux kernel headers to be installed.

🔗 How is the OpenResty XRay agent deployed on K8s?

The OpenResty XRay Agent is usually deployed in a DaemonSet manner in Kubernetes environments.

🔗 Agent Usage and Management

🔗 How much overhead does the agent have?

We strive to minimize the performance impact of the agent program on your servers marked as "production". The agent uses an event-driven sampling method, so it does not constantly try to collect data, only when there is a real need. When not sampling, the additional overhead generated by all your processes is strictly 0. This is due to the truly non-intrusive nature of dynamic tracing. Even when sampling, the overhead of most of our analyzers should be less than 5% of your application. Even for those tools that are originally more expensive, the system will try to automatically adjust the frequency and process range of these analyzers to minimize the impact.

If you do not mark your servers as "production" in the web console, the system will consider them as development or test environments. Therefore, it will no longer be cautious about resource usage, and all analyzers will run at full speed so that you can get results as soon as possible.

🔗 Do I need to restart my processes after installing the agent?

No! One of the advantages of dynamic tracing technology is post-analysis. You do not need to restart your application or any existing processes for the newly installed OpenResty XRay agent to analyze. We can do this because we do not require any new plugins, new startup options, or code injection into your application. It is pollution-free and non-intrusive.

We understand that you may have some processes that have entered some rare states, and restarting them would make the problem disappear. This is why post-analysis and debugging are so critical.

🔗 How can I stop the agent?

To stop the OpenResty XRay agent service, simply run the following shell command.

sudo systemctl stop orxray-agent

But this is only temporary. If the system restarts or reboots, the agent service will start again. To stop it permanently, you can also run this command after running the previous command.

sudo systemctl disable orxray-agent

For containerized agent services, you can stop the agent container instance with Docker or Kubernetes.

🔗 How do I restart the agent?

To restart your agent, simply run the command.

sudo systemctl restart orxray-agent

Wait a few minutes, and the new agent instance will take effect.

🔗 My agent is not working, what should I do?

Sometimes, due to network or hard disk issues, the agent cannot work properly. In this case, check the error log files in the directory.

/usr/local/orxray-agent/logs/

If you need help with the errors in the error log files, please feel free to contact us.

🔗 How to run OpenResty XRay to analyze memory, CPU, etc.?

To run OpenResty XRay to analyze memory, CPU, etc., you can use its guided analysis features. For detailed operation steps and related cases, please refer to the series of articles on XRay online analysis of memory and high CPU issues on the official OpenResty blog.

🔗 Can the agent analyze private software?

Yes, if you have written private software. For example, if you do not have permission from other vendors, you should not analyze their proprietary software. However, if you have written the software or have access to the source code and have permission to compile it, then it is fine. You can even use our Y language (lang) to write advanced analyzers for your program. Make sure you compile private software with DWARF data (or "debug symbols"). For example, C/C++ programs should be compiled with the g or g3 option when using gcc or g++. Compiling with DWARF symbols has no impact on the runtime performance of the program, and most mainstream Linux distributions do this by default in their standard packages.

However, DWARF data is not always required. Some basic analyzers in OpenResty XRay do not require "debug symbols" to work. We once helped a customer accurately locate a memory leak in a third-party proprietary library at the C/C++ function level. But make sure you comply with third-party licensing requirements.

🔗 Data Security

🔗 What data does the agent collect?

The OpenResty XRay agent program only collects basic data used to analyze performance issues, troubleshoot stability and behavioral issues, and scan for security vulnerabilities. We never collect any potentially sensitive data from your business-level code. We also implement safeguards to prevent accidentally collecting sensitive data from data sources so that it does not leak outside your application processes.

🔗 How do you handle the data collected by the agent?

We are very careful to protect our customers' data and privacy. This is our top priority. When transmitting all data to our web console, we always use industry-standard encryption methods (such as TLS). Our web console's data storage and management also comply with all SOC 2 guidelines. Only the raw data of the last 2 weeks is stored in our web console (higher-level report data is stored for a longer period). If some customers have shorter data lifecycle requirements, we can also accommodate them.

🔗 Will you sell or share our data?

No, never. We will not sell your data to any third party. We may only share some audited and obfuscated data with some of our external contractors. And all our contractors must sign a non-disclosure agreement (NDA) with us.

🔗 Can I avoid uploading any data to your console?

Yes! We offer a self-hosted version of OpenResty XRay for companies with strict data handling policies. It is more expensive than the cloud version. For the On-Premise version, users deploy the web console in their own environment; therefore, no data is uploaded to OpenResty Inc.'s servers.

🔗 Debug Symbols and Analysis Capabilities

🔗 Do I need to install debug symbol packages on all my servers?

No. OpenResty XRay indexes all the debug symbols it finds in a remote database called package database. Whenever the agent finds a binary executable, it automatically queries the corresponding debug symbols in the package database.

We run crawlers to continuously obtain debug symbols (or DWARF data) for public software packages on the internet. We also automatically index users' own DWARF data and debug symbols. Each OpenResty XRay tenant has its own independent software package database to protect privacy. If you compile the software yourself, make sure you have an offline (or online) machine with all the software binaries and debug symbols installed and let the OpenResty XRay agent run there (at least for a while). Once the DWARF data and binary programs are indexed into the user's software package database, the user can get rid of the debug symbols on all their machines.

🔗 OpenResty XRay says my program lacks debug symbols, what should I do?

If the program is self-compiled, try to find the debug symbol package related to your main software package (such as *-debuginfo packages on RPM-based distributions, *-dbgsym.ddeb or *-dbgsym.deb files on Deb-based distributions). Install the debuginfo package on a machine with the agent installed and running, and wait for the agent to index the debug symbols.

Suppose your program was compiled without debug symbols, or you cannot find the corresponding debuginfo package. In that case, you can try recompiling your program with debug symbols enabled (for C/C++ programs, pass the -g or -g3 option in the compiler command line). Also, ensure your packaging scripts generate a debuginfo package (such as *-debuginfo*.rpm or *-dbgsym.deb) instead of discarding the debug symbols.

We understand that finding debug symbols can sometimes be a hassle. We are developing an AI system that can automatically reconstruct DWARF data for similar but not identical binary programs from existing DWARF data. Once this is ready, OpenResty XRay will be able to thoroughly analyze a large number of open-source software binaries that lack debug symbols.

It is worth mentioning that some basic analyzers in OpenResty XRay do not require "debug symbols" to work. In fact, we once helped a customer accurately locate a memory leak in a third-party proprietary library at the C/C++ function level.

🔗 Can I write my own analyzers?

Yes! You can use our Y language (or Ylang) to write your own analyzers. Ylang is a large subset of the C programming language with our own dynamic tracing extensions. We also provide the Ylua language, which is a subset of the Lua language with extensions, and YSQL, a SQL dialect.

🔗 Other Questions

🔗 Do these kernel messages have any impact?

🔗 vsyscall read attempt denied

After starting live recording, the kernel may throw messages like the one below. This message is harmless and can be ignored.

[29389.731303] redis-server[298169] vsyscall read attempt denied -- look up the vsyscall kernel parameter if you need a workaround ip:7f000013d241 cs:33 sp:2aaacbcf6f08 ax:0 si:7f00003db659 di:ffffffffff600000

🔗 How many accounts does 1 License support?

1 License supports 2 account logins.

🔗 How to configure HTTP proxy for OpenResty XRay?

If your OpenResty XRay Agent is deployed in an environment that requires accessing the public network through an HTTP proxy, you can configure and use the HTTP proxy by following the steps in this document.

🔗 OpenResty XRay 是什么?

🔗 OpenResty XRay 是什么?

OpenResty XRay 是一个动态追踪产品,它可以实时分析各种云和服务器应用程序。它将运行中的进程和容器视为只读数据库,并提取必要的信息来解决性能问题、异常、错误和安全漏洞。OpenResty XRay 拥有知识库、推理引擎和数百个高级分析器,可以在不改变或影响目标应用程序的情况下诊断和缩小深层问题的根源。

🔗 谁应该使用 OpenResty XRay?

DevOps 可以利用 OpenResty XRay 快速发现任意问题或找出问题根源,然后将发现的问题和生成的自动报告转发给开发人员。

开发团队也可以利用 OpenResty XRay 来检查日常开发中或新的软件产品发布前的任何回归问题。

🔗 OpenResty XRay 可以分析不在 OpenResty 上运行的应用程序吗?

当然!OpenResty XRay 是一个通用平台,可以分析任何软件。好吧,至少是您控制的软件(比如您可以访问 DWARF 的调试符号,源代码等)。

不过,OpenResty XRay 目前分析 OpenResty 和 Nginx 技术栈的效果最好。告诉我们您希望 OpenResty XRay 尽快支持的开源软件!

🔗 OpenResty XRay 需要以任何方式改变我的应用程序吗?

不!OpenResty XRay 使用先进的动态追踪技术,不需要目标应用程序的协作。它是 100% 非侵入的。

  1. 我们不要求在您的应用程序中添加插件或模块。
  2. 我们不需要对您的应用程序的代码打上补丁。
  3. 我们不需要特殊的编译或启动选项(好吧,在编译 C/C++ 程序时,您确实需要 -g 选项来发送 DWARF 数据,但这是非常标准的做法)。
  4. 我们不向您的应用程序进程注入任何代码。

使用 OpenResty XRay 分析器不会以任何方式损害您的应用程序进程甚至使其崩溃,因为我们不会向您的进程添加任何东西。

🔗 是否有提供个人使用的个人版?

是的有提供!只要个人版不用于任何公司、政府或其他商业用途。不过,我们通常不为个人版提供 SLA。

🔗 安装与部署

🔗 如何为我的应用程序部署安装 OpenResty XRay?

您需要在装有应用程序或容器的服务器上安装并运行 OpenResty XRay agent 程序。agent 程序是一个独立的守护进程,可以检查您在同一服务器上的所有应用程序。它也是作为 OpenResty XRay web 控制台的一个客户端。

有几种方法来安装 OpenResty XRay agent。

  1. 安装我们为相应的 Linux 发行版提供的 RPM 或 Deb 软件包库。
  2. 安装一个大的 .tar.gz 包,其中包含我们为您的 Linux 发行版提供的所有 RPM 或 Deb 包。
  3. 安装我们的官方 Docker 或 Kubernetes(K8s)容器镜像。

一个常见的错误是在您自己的容器中安装 agent。这总会失败的,因为您的容器基本总会缺乏权限或文件系统访问权,使 agent 无法检查其他进程和容器。

🔗 我们支持哪些操作系统?

Ubuntu 24.04 noble, Ubuntu 22.04 Jammy, Ubuntu 20.04 Focal, Ubuntu 18.04 Bionic, Debian 12 Bookworm, Debian 11 Bullseye, Debian 10 Buster, Debian 9 Stretch, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 7, Rocky Linux 9, Rocky Linux 8, AlmaLinux 9, AlmaLinux 8, Cent OS 8, Cent OS 7, Cent OS 6, Fedora 36, Fedora 35, Fedora 34, Fedora 33, Fedora 32, Amazon Linux 2023, Amazon Linux 2, Amazon Linux 1, Alibaba Cloud Linux 3, Alibaba Cloud Linux 2, Tencent Linux 3, Tencent Linux 2, OpenSUSE 15, Kylin 10, Kylin 7, CBL-Mariner 2

我们的官方 Docker 或 K8s 容器镜像可以在任何支持容器的现代 Linux 发行版上运行,只要这些目标应用容器内使用的 Linux 发行版在 支持列表 内。

如果您想原生运行 OpenResty XRay 的 agent 服务,我们是支持大多数主流 Linux 发行版的。请查看最新的 发行版支持列表 了解详情。

如果您有新的 Linux 发行版需要原生支持,请联系我们:info@openresty.com!

以后我们可能也会支持非 Linux 操作系统,如 Android、macOS、*BSD 和 Microsoft Windows 等。

🔗 需要非常新的 Linux 内核吗?

不需要!我们支持旧的内核,如 CentOS 7 的 3.10 内核。但不支持像 CentOS 6 的 2.6 这样的旧内核。

🔗 我可以使用我自己的 Linux 内核吗?

可以!但您需要联系我们的团队,以便我们能够在软件包数据库中索引您的内核,并彻底测试它们与我们产品的兼容性。我们还不支持对自定义或未知内核的自动索引。我们可能会考虑在未来增加这一支持。

🔗 是否支持自编译内核?

支持,需要上传相关的内核包。具体需要的内核包可以参考 OpenResty XRay Console 的上传页面。

🔗 OpenResty XRay 支持哪些应用和编程语言?

支持的编程语言与运行时:Python, Java, Rust, Perl, PHP, Erlang, Ruby, Go, LuaJIT, C/C++ 支持的服务器与代理:OpenResty, Envoy, Kong, CockroachDB, Nginx,

🔗 OpenResty XRay agent 能否分析 AWS EKS 上运行的应用?

支持。

🔗 我可以在 VMWare/VirtualBox/KVM/ 等本地虚拟机上使用 OpenResty XRay 吗?

可以!所有这样的全系统虚拟化技术都应该可以与 OpenResty XRay 一起开箱工作。如果不能,请向我们报告。

请注意,不支持在您自己的 Docker 或 K8s 容器内安装我们的 agent。但您可以随时使用我们的官方 Docker 和 K8s 容器镜像来安装 agent。

🔗 我可以在公有云虚拟机中运行 OpenResty XRay 吗?

可以!比如微软 Azure、谷歌云(GCP)、亚马逊云(AWS)或 Digital Ocean。虚拟化的云服务器都可以。不是一定要物理机。

🔗 agent 需要安装 C 编译器工具链吗?

不需要。与那些开源的动态追踪框架如 SystemTapeBPF/BCC 不同,OpenResty XRay 不要求在目标机器上安装任何 C 或 C++ 编译器工具链。没有 gcc,没有 clang,什么都没有。此外,它不需要安装任何 Linux 内核头文件。

🔗 OpenResty XRay agent 是如何部署在 K8s 上的?

OpenResty XRay Agent 在 Kubernetes 环境中通常采用 DaemonSet 的方式进行部署。

🔗 agent 使用与管理

🔗 agent 的开销多大?

我们尽量将 agent 程序对您标记为“生产”的服务器的性能影响降到最低。agent 使用事件触发的采样方法,因此它不会一直试图收集数据,只是在有真正需要的时候才收集。当不采样时,您的所有进程严格意义上产生的额外开销是 0。这是由于动态追踪的真正非侵入性。即使在采样时,我们大多数的分析器的开销也应该小于您的应用的5%。即使是那些原本开销比较昂贵的工具,系统也会尝试自动调整这些分析器的频率和进程范围,以尽量减少影响。

如果您不在 web 控制台中把您的服务器标记为“生产”,系统会认为它们是开发或测试环境。因此,它将不再对资源的使用持谨慎态度,所有的分析器将全速运行,以便您能尽快得到结果。

🔗 安装 agent 后,我需要重新启动我的进程吗?

不需要!动态追踪技术的一个优点是事后分析。您不需要重新启动您的应用程序或任何现有的进程,让新安装的 OpenResty XRay agent 进行分析。我们可以做到这一点,因为我们不需要任何新的插件、新的启动选项,也不需要向您的应用程序注入任何代码。它是无污染和非侵入的。

我们理解,您可能有一些进程进入了一些罕见的状态,重新启动它们会使问题消失。这就是为什么事后分析和调试是如此关键。

🔗 我怎样才能停止 agent?

要停止 OpenResty XRay agent 服务,只需运行以下 shell 命令。

sudo systemctl stop orxray-agent

但这只是暂时的。如果系统重新启动或重启,agent 服务会再次启动。要永久停止它,您也可以在运行前一个命令后再运行这个命令。

sudo systemctl disable orxray-agent

对于容器化的 agent 服务,您可以用 Docker 或 Kubernetes 停止 agent 容器实例。

🔗 我如何重新启动 agent?

要重新启动您的 agent,只需运行命令

sudo systemctl restart orxray-agent

等待几分钟,新的 agent 实例就会生效。

🔗 我的 agent 不工作了,我应该怎么做?

有些时候,由于网络或硬盘问题,agent 不能正常工作。在这种情况下,请查看该目录下的错误日志文件。

/usr/local/orxray-agent/logs/

如果您对错误日志文件中的错误还需要帮助,请随时联系我们。

🔗 如何运行 OpenResty XRay 分析内存、CPU 等问题?

要运行 OpenResty XRay 分析内存、CPU 等问题,您可以利用其引导式分析功能。详细的操作步骤和相关案例,请参阅 OpenResty 官方博客中关于 XRay 线上分析内存及高 CPU 问题的系列文章。

🔗 agent 可以分析私人软件吗?

是的,如果您编写了私有软件的话。例如,如果您没有得到其他供应商的许可,您就不应该分析他们的专有软件。但是,如果您编写了这个软件,或者有机会接触到源代码,并且有编译的权限,那就可以了。而且您甚至可以使用我们的 Y 语言(lang)来为您的程序编写高级分析器。请确保您用 DWARF 数据(或 "调试符号")来编译私有软件。例如,C/C++ 程序在使用 gccg++ 时,应使用 gg3 选项进行编译。使用 DWARF 符号编译对程序的运行性能没有任何影响,大多数主流的 Linux 发行版在其标准软件包中都默认这样做。

然而,DWARF 数据并不总是必需的。OpenResty XRay 中一些基本分析器不需要“调试符号”来工作。我们曾经帮助一个客户在 C/C++ 函数层面上准确定位了一个第三方专有库的内存泄漏。但要确保您符合第三方的许可要求。

🔗 数据安全

🔗 agent 会收集哪些数据?

OpenResty XRay agent 程序只收集用于分析性能问题、排除稳定性和行为上的问题以及扫描安全漏洞的基本数据。我们从不从您的业务级代码中收集任何潜在的敏感数据。我们还实施保护措施,以避免意外地收集数据源中的敏感数据,使其不会泄露到您的应用程序进程之外。

🔗 你们如何处理 agent 收集的数据?

我们非常谨慎地保护我们客户的数据和隐私。这是我们的第一要务。在传输所有数据到我们的 web 控制台时,我们总是使用工业标准的加密方法(如 TLS)。我们 web 控制台的数据存储和管理也符合所有 SOC 2 准则。只有最近 2 周的原始数据存放在我们的 web 控制台中(更高级别的报告数据存放时间更长些)。如果有些客户有更短的数据生命周期要求,我们也可以满足。

🔗 你们会出售或分享我们的数据吗?

不,永远不会。我们不会把您的数据卖给任何第三方。我们只可能与我们的一些外部承包商分享一些经过审计和混淆的数据。而我们所有的承包商必须与我们签署保密协议(NDA)。

🔗 我可以避免上传任何数据到你们的控制台吗?

是的!我们为有严格的数据处理政策的公司提供 OpenResty XRay 的自主部署版本。它比云版本更贵。对于自主部署版本,用户在自己的环境中部署 web 控制台;因此,没有数据会被上传到 OpenResty Inc 的服务器上。

🔗 调试符号与分析能力

🔗 我需要在我所有的服务器上安装调试符号包吗?

不需要。OpenResty XRay 在一个叫做 package database 的远程数据库中索引它发现的所有调试符号。每当 agent 发现一个二进制的可执行文件,它就会自动查询包数据库中相应的调试符号。

我们运行爬虫程序,在互联网上一直获取公共软件包的调试符号(或 DWARF 数据)。而且我们还自动索引用户自己的 DWARF 数据和调试符号。每个 OpenResty XRay 租户都有自己独立的软件包数据库以保护隐私。如果您自己编译软件,那么请确保您有一台离线(或在线)的机器,安装了所有的软件二进制文件和调试符号,并且让 OpenResty XRay agent 在那运行(至少有一段时间)。一旦 DWARF 数据和二进制程序被索引到用户的软件包数据库中,用户就可以在他所有的机器上摆脱调试符号了。

🔗 OpenResty XRay 说我的程序缺乏调试符号,我应该怎么做?

如果程序是自行编译的,试着找到与您的主软件包相关的调试符号包(比如基于 RPM 的发行版上的 *-debuginfo 包,基于 Deb 的发行版上的 *-dbgsym.ddeb*-dbgsym.deb文件)。将 debuginfo 包安装在一台安装并运行了 agent 的机器上,并等待 agent 对调试符号进行索引。

假设您的程序在编译时没有调试符号,或者您找不到相应的 debuginfo 包。在这种情况下,您可以尝试在启用调试符号的情况下重新编译您的程序(对于 C/C++ 程序,在编译器命令行中传递 -g-g3选项)。另外,确保您的打包脚本生成一个 debuginfo 包(如 *-debuginfo*.rpm*-dbgsym.deb),而不是把调试符号丢弃。

我们理解寻找调试符号有时是一件很麻烦的事。我们一直在开发一个人工智能系统,可以从现有的 DWARF 数据中自动重建相似但不完全相同的二进制程序的 DWARF 数据。一旦这个准备就绪,OpenResty XRay 将能够彻底分析大量缺少调试符号的开源软件二进制文件。

值得一提的是,OpenResty XRay 中的一些基本分析器并不要求“调试符号”来工作。事实上,我们曾经帮助一个客户在 C/C++ 函数层面上准确定位了一个第三方专有库的内存泄漏。

🔗 我可以编写自己的分析器吗?

可以!您可以使用我们的 Y 语言(或 Ylang)来编写您自己的分析器。Ylang 是 C 编程语言的一个大的子集,有我们自己的动态追踪的扩展。我们还提供了 Ylua 语言,这是一个带有扩展的 Lua 语言的子集,以及 YSQL,一个 SQL 方言。

🔗 其他问题

🔗 这些内核消息是否有影响

🔗 vsyscall read attempt denied

在启动现场录制后,内核可能会抛出类似下面这样的消息。这个消息是无害的,可以忽略。

[29389.731303] redis-server[298169] vsyscall read attempt denied -- look up the vsyscall kernel parameter if you need a workaround ip:7f000013d241 cs:33 sp:2aaacbcf6f08 ax:0 si:7f00003db659 di:ffffffffff600000

🔗 1 个 License 支持多少个账户登录?

1 个 License 支持 2 个账号登录。

🔗 OpenResty XRay 怎么配置 HTTP 代理?

如果您的 OpenResty XRay Agent 部署在一个需要通过 HTTP 代理访问公网的环境中,您可以按照该文档的步骤配置和使用 HTTP 代理。

🔗 OpenResty XRay 是甚麼?

🔗 OpenResty XRay 是甚麼?

OpenResty XRay 是一個動態追蹤產品,它可以實時分析各種雲和伺服器應用程式。它將執行中的程序和容器視為只讀資料庫,並提取必要的資訊來解決效能問題、異常、錯誤和安全漏洞。OpenResty XRay 擁有知識庫、推理引擎和數百個高階分析器,可以在不改變或影響目標應用程式的情況下診斷和縮小深層問題的根源。

🔗 誰應該使用 OpenResty XRay?

DevOps 可以利用 OpenResty XRay 快速發現任意問題或找出問題根源,然後將發現的問題和生成的自動報告轉發給開發人員。

開發團隊也可以利用 OpenResty XRay 來檢查日常開發中或新的軟體產品釋出前的任何回歸問題。

🔗 OpenResty XRay 可以分析不在 OpenResty 上執行的應用程式嗎?

當然!OpenResty XRay 是一個通用平臺,可以分析任何軟體。好吧,至少是您控制的軟體(比如您可以訪問 DWARF 的除錯符號,原始碼等)。

不過,OpenResty XRay 目前分析 OpenResty 和 Nginx 技術棧的效果最好。告訴我們您希望 OpenResty XRay 儘快支援的開源軟體!

🔗 OpenResty XRay 需要以任何方式改變我的應用程式嗎?

不!OpenResty XRay 使用先進的動態追蹤技術,不需要目標應用程式的協作。它是 100% 非侵入的。

  1. 我們不要求在您的應用程式中新增外掛或模組。
  2. 我們不需要對您的應用程式的程式碼打上補丁。
  3. 我們不需要特殊的編譯或啟動選項(好吧,在編譯 C/C++ 程式時,您確實需要 -g 選項來傳送 DWARF 資料,但這是非常標準的做法)。
  4. 我們不向您的應用程式程序注入任何程式碼。

使用 OpenResty XRay 分析器不會以任何方式損害您的應用程式程序甚至使其崩潰,因為我們不會向您的程序新增任何東西。

🔗 是否有提供個人使用的個人版?

是的有提供!只要個人版不用於任何公司、政府或其他商業用途。不過,我們通常不為個人版提供 SLA。

🔗 安裝與部署

🔗 如何為我的應用程式部署安裝 OpenResty XRay?

您需要在裝有應用程式或容器的伺服器上安裝並執行 OpenResty XRay agent 程式。agent 程式是一個獨立的守護程序,可以檢查您在同一伺服器上的所有應用程式。它也是作為 OpenResty XRay web 控制檯的一個客戶端。

有幾種方法來安裝 OpenResty XRay agent。

  1. 安裝我們為相應的 Linux 發行版提供的 RPM 或 Deb 軟體包庫。
  2. 安裝一個大的 .tar.gz 包,其中包含我們為您的 Linux 發行版提供的所有 RPM 或 Deb 包。
  3. 安裝我們的官方 Docker 或 Kubernetes(K8s)容器映象。

一個常見的錯誤是在您自己的容器中安裝 agent。這總會失敗的,因為您的容器基本總會缺乏許可權或檔案系統訪問權,使 agent 無法檢查其他程序和容器。

🔗 我們支援哪些作業系統?

Ubuntu 24.04 noble, Ubuntu 22.04 Jammy, Ubuntu 20.04 Focal, Ubuntu 18.04 Bionic, Debian 12 Bookworm, Debian 11 Bullseye, Debian 10 Buster, Debian 9 Stretch, Red Hat Enterprise Linux 8, Red Hat Enterprise Linux 7, Rocky Linux 9, Rocky Linux 8, AlmaLinux 9, AlmaLinux 8, Cent OS 8, Cent OS 7, Cent OS 6, Fedora 36, Fedora 35, Fedora 34, Fedora 33, Fedora 32, Amazon Linux 2023, Amazon Linux 2, Amazon Linux 1, Alibaba Cloud Linux 3, Alibaba Cloud Linux 2, Tencent Linux 3, Tencent Linux 2, OpenSUSE 15, Kylin 10, Kylin 7, CBL-Mariner 2

我們的官方 Docker 或 K8s 容器映象可以在任何支援容器的現代 Linux 發行版上執行,只要這些目標應用容器內使用的 Linux 發行版在 支援列表 內。

如果您想原生執行 OpenResty XRay 的 agent 服務,我們是支援大多數主流 Linux 發行版的。請檢視最新的 發行版支援列表 瞭解詳情。

如果您有新的 Linux 發行版需要原生支援,請聯絡我們:info@openresty.com!

以後我們可能也會支援非 Linux 作業系統,如 Android、macOS、*BSD 和 Microsoft Windows 等。

🔗 需要非常新的 Linux 核心嗎?

不需要!我們支援舊的核心,如 CentOS 7 的 3.10 核心。但不支援像 CentOS 6 的 2.6 這樣的舊核心。

🔗 我可以使用我自己的 Linux 核心嗎?

可以!但您需要聯絡我們的團隊,以便我們能夠在軟體包資料庫中索引您的核心,並徹底測試它們與我們產品的相容性。我們還不支援對自定義或未知核心的自動索引。我們可能會考慮在未來增加這一支援。

🔗 是否支援自編譯核心?

支援,需要上傳相關的核心包。具體需要的核心包可以參考 OpenResty XRay Console 的上傳頁面。

🔗 OpenResty XRay 支援哪些應用和程式語言?

支援的程式語言與執行時:Python, Java, Rust, Perl, PHP, Erlang, Ruby, Go, LuaJIT, C/C++ 支援的伺服器與代理:OpenResty, Envoy, Kong, CockroachDB, Nginx,

🔗 OpenResty XRay agent 能否分析 AWS EKS 上執行的應用?

支援。

🔗 我可以在 VMWare/VirtualBox/KVM/ 等本地虛擬機器上使用 OpenResty XRay 嗎?

可以!所有這樣的全系統虛擬化技術都應該可以與 OpenResty XRay 一起開箱工作。如果不能,請向我們報告。

請注意,不支援在您自己的 Docker 或 K8s 容器內安裝我們的 agent。但您可以隨時使用我們的官方 Docker 和 K8s 容器映象來安裝 agent。

🔗 我可以在公有云虛擬機器中執行 OpenResty XRay 嗎?

可以!比如微軟 Azure、谷歌雲(GCP)、亞馬遜雲(AWS)或 Digital Ocean。虛擬化的雲伺服器都可以。不是一定要物理機。

🔗 agent 需要安裝 C 編譯器工具鏈嗎?

不需要。與那些開源的動態追蹤框架如 SystemTapeBPF/BCC 不同,OpenResty XRay 不要求在目標機器上安裝任何 C 或 C++ 編譯器工具鏈。沒有 gcc,沒有 clang,甚麼都沒有。此外,它不需要安裝任何 Linux 核心標頭檔案。

🔗 OpenResty XRay agent 是如何部署在 K8s 上的?

OpenResty XRay Agent 在 Kubernetes 環境中通常採用 DaemonSet 的方式進行部署。

🔗 agent 使用與管理

🔗 agent 的開銷多大?

我們儘量將 agent 程式對您標記為“生產”的伺服器的效能影響降到最低。agent 使用事件觸發的取樣方法,因此它不會一直試圖收集資料,只是在有真正需要的時候才收集。當不取樣時,您的所有程序嚴格意義上產生的額外開銷是 0。這是由於動態追蹤的真正非侵入性。即使在取樣時,我們大多數的分析器的開銷也應該小於您的應用的5%。即使是那些原本開銷比較昂貴的工具,系統也會嘗試自動調整這些分析器的頻率和程序範圍,以儘量減少影響。

如果您不在 web 控制檯中把您的伺服器標記為“生產”,系統會認為它們是開發或測試環境。因此,它將不再對資源的使用持謹慎態度,所有的分析器將全速執行,以便您能儘快得到結果。

🔗 安裝 agent 後,我需要重新啟動我的程序嗎?

不需要!動態追蹤技術的一個優點是事後分析。您不需要重新啟動您的應用程式或任何現有的程序,讓新安裝的 OpenResty XRay agent 進行分析。我們可以做到這一點,因為我們不需要任何新的外掛、新的啟動選項,也不需要向您的應用程式注入任何程式碼。它是無汙染和非侵入的。

我們理解,您可能有一些程序進入了一些罕見的狀態,重新啟動它們會使問題消失。這就是為甚麼事後分析和除錯是如此關鍵。

🔗 我怎樣才能停止 agent?

要停止 OpenResty XRay agent 服務,只需執行以下 shell 命令。

sudo systemctl stop orxray-agent

但這只是暫時的。如果系統重新啟動或重啟,agent 服務會再次啟動。要永久停止它,您也可以在執行前一個命令後再執行這個命令。

sudo systemctl disable orxray-agent

對於容器化的 agent 服務,您可以用 Docker 或 Kubernetes 停止 agent 容器例項。

🔗 我如何重新啟動 agent?

要重新啟動您的 agent,只需執行命令

sudo systemctl restart orxray-agent

等待幾分鐘,新的 agent 例項就會生效。

🔗 我的 agent 不工作了,我應該怎麼做?

有些時候,由於網路或硬碟問題,agent 不能正常工作。在這種情況下,請檢視該目錄下的錯誤日誌檔案。

/usr/local/orxray-agent/logs/

如果您對錯誤日誌檔案中的錯誤還需要幫助,請隨時聯絡我們。

🔗 如何執行 OpenResty XRay 分析記憶體、CPU 等問題?

要執行 OpenResty XRay 分析記憶體、CPU 等問題,您可以利用其引導式分析功能。詳細的操作步驟和相關案例,請參閱 OpenResty 官方部落格中關於 XRay 線上分析記憶體及高 CPU 問題的系列文章。

🔗 agent 可以分析私人軟體嗎?

是的,如果您編寫了私有軟體的話。例如,如果您沒有得到其他供應商的許可,您就不應該分析他們的專有軟體。但是,如果您編寫了這個軟體,或者有機會接觸到原始碼,並且有編譯的許可權,那就可以了。而且您甚至可以使用我們的 Y 語言(lang)來為您的程式編寫高階分析器。請確保您用 DWARF 資料(或 "除錯符號")來編譯私有軟體。例如,C/C++ 程式在使用 gccg++ 時,應使用 gg3 選項進行編譯。使用 DWARF 符號編譯對程式的執行效能沒有任何影響,大多數主流的 Linux 發行版在其標準軟體包中都預設這樣做。

然而,DWARF 資料並不總是必需的。OpenResty XRay 中一些基本分析器不需要“除錯符號”來工作。我們曾經幫助一個客戶在 C/C++ 函式層面上準確定位了一個第三方專有庫的記憶體洩漏。但要確保您符合第三方的許可要求。

🔗 資料安全

🔗 agent 會收集哪些資料?

OpenResty XRay agent 程式只收集用於分析效能問題、排除穩定性和行為上的問題以及掃描安全漏洞的基本資料。我們從不從您的業務級程式碼中收集任何潛在的敏感資料。我們還實施保護措施,以避免意外地收集資料來源中的敏感資料,使其不會洩露到您的應用程式程序之外。

🔗 你們如何處理 agent 收集的資料?

我們非常謹慎地保護我們客戶的資料和隱私。這是我們的第一要務。在傳輸所有資料到我們的 web 控制檯時,我們總是使用工業標準的加密方法(如 TLS)。我們 web 控制檯的資料儲存和管理也符合所有 SOC 2 準則。只有最近 2 周的原始資料存放在我們的 web 控制檯中(更高階別的報告資料存放時間更長些)。如果有些客戶有更短的資料生命週期要求,我們也可以滿足。

🔗 你們會出售或分享我們的資料嗎?

不,永遠不會。我們不會把您的資料賣給任何第三方。我們只可能與我們的一些外部承包商分享一些經過審計和混淆的資料。而我們所有的承包商必須與我們簽署保密協議(NDA)。

🔗 我可以避免上傳任何資料到你們的控制檯嗎?

是的!我們為有嚴格的資料處理政策的公司提供 OpenResty XRay 的自主部署版本。它比雲版本更貴。對於自主部署版本,使用者在自己的環境中部署 web 控制檯;因此,沒有資料會被上傳到 OpenResty Inc 的伺服器上。

🔗 除錯符號與分析能力

🔗 我需要在我所有的伺服器上安裝除錯符號包嗎?

不需要。OpenResty XRay 在一個叫做 package database 的遠端資料庫中索引它發現的所有除錯符號。每當 agent 發現一個二進位制的可執行檔案,它就會自動查詢包資料庫中相應的除錯符號。

我們執行爬蟲程式,在網際網路上一直獲取公共軟體包的除錯符號(或 DWARF 資料)。而且我們還自動索引使用者自己的 DWARF 資料和除錯符號。每個 OpenResty XRay 租戶都有自己獨立的軟體包資料庫以保護隱私。如果您自己編譯軟體,那麼請確保您有一臺離線(或線上)的機器,安裝了所有的軟體二進位制檔案和除錯符號,並且讓 OpenResty XRay agent 在那執行(至少有一段時間)。一旦 DWARF 資料和二進位制程式被索引到使用者的軟體包資料庫中,使用者就可以在他所有的機器上擺脫除錯符號了。

🔗 OpenResty XRay 說我的程式缺乏除錯符號,我應該怎麼做?

如果程式是自行編譯的,試著找到與您的主軟體包相關的除錯符號包(比如基於 RPM 的發行版上的 *-debuginfo 包,基於 Deb 的發行版上的 *-dbgsym.ddeb*-dbgsym.deb檔案)。將 debuginfo 包安裝在一臺安裝並執行了 agent 的機器上,並等待 agent 對除錯符號進行索引。

假設您的程式在編譯時沒有除錯符號,或者您找不到相應的 debuginfo 包。在這種情況下,您可以嘗試在啟用除錯符號的情況下重新編譯您的程式(對於 C/C++ 程式,在編譯器命令列中傳遞 -g-g3選項)。另外,確保您的打包指令碼生成一個 debuginfo 包(如 *-debuginfo*.rpm*-dbgsym.deb),而不是把除錯符號丟棄。

我們理解尋找除錯符號有時是一件很麻煩的事。我們一直在開發一個人工智慧系統,可以從現有的 DWARF 資料中自動重建相似但不完全相同的二進位制程式的 DWARF 資料。一旦這個準備就緒,OpenResty XRay 將能夠徹底分析大量缺少除錯符號的開源軟體二進位制檔案。

值得一提的是,OpenResty XRay 中的一些基本分析器並不要求“除錯符號”來工作。事實上,我們曾經幫助一個客戶在 C/C++ 函式層面上準確定位了一個第三方專有庫的記憶體洩漏。

🔗 我可以編寫自己的分析器嗎?

可以!您可以使用我們的 Y 語言(或 Ylang)來編寫您自己的分析器。Ylang 是 C 程式語言的一個大的子集,有我們自己的動態追蹤的擴充套件。我們還提供了 Ylua 語言,這是一個帶有擴充套件的 Lua 語言的子集,以及 YSQL,一個 SQL 方言。

🔗 其他問題

🔗 這些核心訊息是否有影響

🔗 vsyscall read attempt denied

在啟動現場錄製後,核心可能會丟擲類似下面這樣的訊息。這個訊息是無害的,可以忽略。

[29389.731303] redis-server[298169] vsyscall read attempt denied -- look up the vsyscall kernel parameter if you need a workaround ip:7f000013d241 cs:33 sp:2aaacbcf6f08 ax:0 si:7f00003db659 di:ffffffffff600000

🔗 1 個 License 支援多少個賬戶登入?

1 個 License 支援 2 個賬號登入。

🔗 OpenResty XRay 怎麼配置 HTTP 代理?

如果您的 OpenResty XRay Agent 部署在一個需要透過 HTTP 代理訪問公網的環境中,您可以按照該文件的步驟配置和使用 HTTP 代理。