search
HomeDatabaseMysql Tutorial在DB2客户端服务器环境中经济高效的实现RDMA功能

诸如主机适配器和 Ethernet 交换机之类的 LAN 网络设备在过去几年中得到了较大的发展,使得实现高达 40Gbps 的吞吐量以及低于 1 微秒的网络延迟成为可能。计算能力和 LAN 设备不再是一个瓶颈。

相反,在这个高性能硬件的新时代里,TCP 之类的协议变成了真正的瓶颈。为了克服 TCP 局限性,人们开发了诸如 Remote Direct Memory Access (RDMA) 之类的新协议。本文将介绍一种经济高效的方法,可使用该方法在 DB2 客户端环境中实现 RDMA 功能,而不需要重新编码和重新编译现有应用程序

RDMA 是一种支持计算机绕过操作系统(内核和 TCP 堆栈)访问其他计算机上内存位置的机制。与传统的基于 TCP 的软硬件架构相比较,RDMA 有几个优势。内核旁路 (Kernel bypass) 意味着缩短了两个应用程序之间的路径,并减少了 CPU 利用率。通过直接在网络适配器和应用程序内存(用户空间)之间传输数据减少了特定于 TCP 的协议开销,无需将数据复制到内核空间并进行缓存。

为了充分利用 RDMA 提供的所有优势,需要使用 RDMA 语义或上层协议,比如 User-Level Direct Access Transport (uDAPL) 或 Message Passing Interface (MPI) 来编写应用程序。然而,对于 RDMA 来说,重写一个 TCP 应用程序可能非常昂贵,因此,针对这种情况开发了一个替代解决方案。该方法称之为 Direct Socket Protocol (SDP),无需重新编码任何应用程序。

SDP 是一个连线协议,在 RDMA 能力的适配器和套接字之间使用。鉴于这个原因,SDP 对应用程序是透明的,而标准流套接字的实现不需要使用另一个 API 替换。DB2 应用程序和 DB2 服务器无需修改就可在 SDP 或 TCP 上运行。用户只需要在执行应用程序之前通过预加载 SDP 共享库来选择要使用的协议即可。所有关于 TCP 的设置,比如主机名、IP 地址和端口,均无需修改。

例如,一个使用 TCP 连接到服务器的 Java 应用程序也可以使用相同 JDBC URL 在 SDP 上运行。该 SDP 库,一旦预加载之后,将根据一组在 /etc/libsdp.conf 中定义的规则,以及服务器接受的协议来决定必需启动哪个协议。默认规则指定 SDP 作为第一个选项,如果连接失败,SDP 库将退回到 TCP。

一个应用程序可以只使用 SDP,或者只使用 TCP,或者同时使用二者。例如,可以将一个应用程序配置为使用 SDP 实现 DB2 数据库连接以及使用 TCP 实现 LDAP 连接。数据库和 LDAP 服务器可以在不同的物理机器上运行,或者运行在相同的机器上但侦听不同的接口。本文稍后将讨论各种场景以及如何应用规则。

硬件和软件基础架构

RDMA 需要专用的硬件和软件基础架构。本文将讨论 Linux x86 平台上的 SDP。

  • 主机适配器

    两类主机适配器支持 RDMA:Infiniband 适配器和 RoCE 适配器。前者需要 Infiniband 交换机,而后者需要 Ethernet 交换机。

    本例使用 Mellanox RoCE 适配器。本文提供的所有指令均适用于 Infiniband 适配器,只需稍作修改或无需修改。RoCE (RDMA over Converged Ethernet) 是 Infiniband over Ethernet 协议的一个实现。Converged Ethernet 网络允许不同类型的协议共享同一个媒介。定期封装 IP 数据包、Infiniband over Ethernet 和 Fiber Channel over Ethernet 的 LAN Ethernet 框架都可在一个 Ethernet 线路中共存。

  • 设备驱动程序

    这里有几个关于操作 Mellanox 适配器所需要的设备驱动程序和工具。所有可用的设备驱动程序和工具都是以 OpenFabrics Alliance 维护的 OFED 堆栈为基础。

  • 操作系统

    Red Hat Linux 6.2,内核版本 2.6.32-220.4.1.el6.x86_64。

  • Ethernet 交换机

    10Gbps RackSwitch G8264,操作系统版本 6.8.1.0。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment