F-Stack/f-stack

In the consumer mode Fstack has pool performance comparing to Linux socket

uvletter opened this issue · 3 comments

In the scene that a server only read data from client, the throughput of server based on Fstack is far less than Linux socket,
the example code likes the below:

if (event.filter == EVFILT_READ) {
            char buf[4096];
            ssize_t readlen = ff_read(clientfd, buf, sizeof(buf));
}

the client likes this:

        conn, err := net.Dial("tcp", addr)
	panicIfNeed(err)

	buf := make([]byte, sz)
	for {
		n, err := conn.Write(buf)
		panicIfNeed(err)

		if n != len(buf) {
			panic("short write")
		}
	}

In 4KB payload

model throughput(Byte/s)
Linux socket 1877778432
Fstack 672063488

If anyone has some ideas about it, thanks!

Did you use two different machines? Do you actually use a SmartNIC or do run fstack in VM?

The default configuration is optimized for large concurrency. If you only test a single connection, you need to modify some parameter configurations, such as pkt_tx_delay, etc.

And you're better off testing on two different servers, I don't know how you design your tests on a single service.