DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default A speed test with Iperf , Relayd and PF.

Hi all,

I am conducting some speed test inside my LAN evironment .
The actual testing network topology is as follow :

Iperf Client --> OpenBSD7.1 Proxy --> host server iperf

All the connections are with CAT 6 and running at 1000 Mbps speed .(1Gbps)

The interface 10.10.10.2 is em0 or the interface facing the outside.
The IP address of the iperf server is part of the network behind the Relay
with an address of 192.168.20.9.

With Iperf from the server side, I am using the default TCP window size (128KByte), as well from the client side .

When I use this relay with RELAYD :

Code:
tcp connection fixup {
  tcp nodelay
}

relay IPERF_TEST{
  listen on 10.10.10.2 port 6740 
  forward to 192.168.20.9 port 6670
  protocol fixup
}
With IPERF I obtain a speed of 144Mbps .

If instead, I deactivate the relayd function and using a simple PF redirecting with

Code:
pass in on em0 proto {tcp} from any to em0 port 6740 rdr-to 192.168.20.9 port 6670
I obtain a speed of 892 Mbps.

(which I should expect the same as normal for being a 1Gbps link)

This make me wonder now why using RELAYD makes the TCP redirection so slow and how to improve it since I will need to use Relayd for a HTTP-->HTTPS redirect for example using SNI for different domains.
Reply With Quote
  #2   (View Single Post)  
Old 11th May 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Hello, and welcome!


I don't know iperf at all, and do not currently have relayd(8) provisioned with any server. With that rather large disclaimer out of the way...


You might check to see if the number of relay handling processes provisioned makes a performance difference for you. See "prefork" in relayd.conf(5).
Reply With Quote
  #3   (View Single Post)  
Old 11th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default

Thank You for the reply. Well I am using prefork with 10 instead of 5 (the default)... i think would be enough?
Reply With Quote
  #4   (View Single Post)  
Old 11th May 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Sorry that it was no help. (The default is 3, though that doesn't matter as you already have it set higher.)
Reply With Quote
  #5   (View Single Post)  
Old 12th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default

Looks like something on how RELAYD is handling the process or how it fragments the TCP windows to the outside interface.. Even if I redirect to a loopback from the outside interface is the same... I am using the OpenBSD base system I was able to successfully redirect the traffic to subdomains using SNI without httpd or nginx but this really is a tweaking obstacle .
Reply With Quote
  #6   (View Single Post)  
Old 12th May 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

If no one else chimes in here in the next day or two you might want to post to the Project's misc@ mailing list. You will have a much larger audience. If you do post there, be sure to include your relay.conf provisioning (redacting any private information).
Reply With Quote
  #7   (View Single Post)  
Old 13th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default

Thank You, I just sent an email there. If I find a usable solution will report it also here.
Reply With Quote
  #8   (View Single Post)  
Old 15th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default

Ok the problem was not related to RelayD , but to the virtualized interface , that wasn't enabled with multiprocessor option and para-virtualization (was running as an emulation of a e1000 interface)

So far so good, now the speed is consistent.
Reply With Quote
  #9   (View Single Post)  
Old 15th May 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I'm glad you were able to identify the root cause!
Reply With Quote
Old 20th May 2022
Woden27 Woden27 is offline
Port Guard
 
Join Date: May 2022
Posts: 12
Default

Thanks for Your support.
I have noticed that other people here is searching for a complete RelayD configuration to avoid using NGINX or HTTPD. We'll try to post it in the future as it working very well as reverse proxy.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding relayd sleepyjoe OpenBSD Security 2 26th April 2020 05:30 AM
Test server barti OpenBSD General 4 2nd August 2012 08:11 AM
relayd gpatrick OpenBSD General 0 8th May 2012 10:10 PM
relayd gpatrick OpenBSD General 1 16th January 2010 12:19 AM


All times are GMT. The time now is 02:19 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick