简体   繁体   English

使用OpenOnload Solarflare c获得性能提升

[英]Performance gain using OpenOnload Solarflare c

I am trying to measure performance gain in my system using Solarflare NIC installed in my server. 我正在尝试使用服务器中安装的Solarflare NIC来评估系统的性能提升。

Server details : Intel(R) Core(TM) i7-8086K CPU @ 4.00GHz (12 cores/ 8 GB RAM) 服务器详细信息 :英特尔(R)酷睿TM i7-8086K CPU @ 4.00GHz(12核/ 8 GB RAM)

Network : Solarflare XtremeScale X2522 (10G) Adapter 网络 :Solarflare XtremeScale X2522(10G)适配器

I have written a simple TCP/IP server/client program in C++. 我已经用C ++编写了一个简单的TCP / IP服务器/客户端程序。 Server/Client both take two inputs viz. 服务器/客户端都接受两个输入。 Buffer size and interface name. 缓冲区大小和接口名称。 Using setsockopt I am able to use SO_BINDTODEVICE for binding my socket to specific interface. 使用setsockopt,我可以使用SO_BINDTODEVICE将套接字绑定到特定接口。

        const char *device = argv[2];
        int rc1=setsockopt(server_fd, SOL_SOCKET, SO_BINDTODEVICE, device, strlen(device));
        if (rc1 != 0)
        {
            cerr << "set sockopt bindtodevice failed: " << strerror(errno) << endl;
            exit(1);
        }

The above snippet of code I have used in both client and server.cpp programs. 我在client和server.cpp程序中都使用了上面的代码片段。

For measuring latency, I have used chrono timestamp in microseconds before and after sending 10000000 messages from client of size 2048 each. 为了测量延迟,在从大小为2048的客户端发送10000000消息前后,我使用了微秒级的chrono时间戳。

I am binding the socket to solarflare interface using SO_BINDTODEVICE + using following commands to run the client server programs: 我使用以下命令运行SO_BINDTODEVICE +将套接字绑定到solarflare接口,以运行客户端服务器程序:

onload ./client (buf_size) (interface_name_solarflare) onload ./client(buf_size)(interface_name_solarflare)

onload ./server (buf_size) (interface_name_solarflare) onload ./server(buf_size)(interface_name_solarflare)

And for benchmarking without onload: 对于无负载的基准测试:

./client (buf_size) (interface_name) ./client(buf_size)(接口名称)

./server (buf_size) (interface_name) ./服务器(buf_size)(接口名称)

What I am able to observe is that the latency in case of onload is higher than without onload. 我能够观察到的是,在onload情况下的延迟比没有onload情况下的延迟高。 I've tried varying buffer size as well. 我也尝试过更改缓冲区大小。 This is only send time. 这只是发送时间。

My sample results in microseconds: 我的样本结果以微秒为单位:

在此处输入图片说明

Can someone please guide me what I might be doing wrong here? 有人可以指导我在这里做错什么吗? I am new to using OpenOnLoad. 我是使用OpenOnLoad的新手。

Note: I haven't used any other setsockopt options in my client/server programs. 注意:我的客户端/服务器程序中没有使用过任何其他setsockopt选项。

Thanks in advance. 提前致谢。 :) :)

我认为您可以为客户端和服务器创建单独的命名空间,然后进行测试(以防您没有两个系统)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM