Seastar httpd example

I am building simple httpd application example in apps. I wonder if http source in seastar handles json body when sending post request and if not if there are some projects that do so : scylladb database, etc?


Hello, don’t know about seastar example but for sure we handle json and post in alternator (dynamodb api), see scylladb/alternator/ at 7cb1c10fed4874bdce752852fdc4a0ee1abfb8d2 · scylladb/scylladb · GitHub


Thanks for information, I got inspiration from server part of scylladb and I wanted to test server performance using seastar library.

The idea was to bench with the oio-sds (GitHub - open-io/oio-sds: High Performance Software-Defined Object Storage for Big Data and AI, that supports Amazon S3 and Openstack Swift) open source solution where a proxy server targets an sqlite3 database as backend.
Here my idea was to build a proxy that writes into foundationdb database: GitHub - laitassou/proxy

I am disappointed because . both solutions struggle at about 300 write operation per seconds:

s$ ./tools/benchmark/ -c 1 -n 100
Creating 100 objects.
End. 100 objects created in 0.362761s, 275.663213 objects per second.
(venv-oio-sds-main) laitasso@laptop1352154:~/devel/oio/oio-sds$ ./tools/benchmark/ -c 1 -n 100
Creating 100 objects.
End. 100 objects created in 0.612400s, 163.292079 objects per second.
/devel/oio/oio-sds$ ./tools/benchmark/ -c 1 -n 100
Creating 100 objects.
End. 100 objects created in 0.396632s, 252.123054 objects per second.
:~/devel/oio/oio-sds$ ./tools/benchmark/ -c 1 -n 100
Creating 100 objects.
End. 100 objects created in 0.431732s, 231.625335 objects per second.
:~/devel/oio/oio-sds$ ./tools/benchmark/ -c 1 -n 100

Any idea because I am far from httpd server performance here HTTPD benchmark · scylladb/seastar Wiki · GitHub
I know I am not using any dpdk etc? but I expect much more.

Here is my startup program:

Starting program: /home/laitasso/code/proxy/apps/build/httpd/httpd --port 6100 --host-ipv4-addr -c 8
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
WARN  2024-04-09 09:49:26,150 seastar - Requested AIO slots too large, please increase request capacity in /proc/sys/fs/aio-max-nr. available:54126 requested:88208
WARN  2024-04-09 09:49:26,150 seastar - max-networking-io-control-blocks adjusted from 10000 to 5739, since AIO slots are unavailable
INFO  2024-04-09 09:49:26,150 seastar - Reactor backend: io_uring
[New Thread 0x7ffff3bff640 (LWP 3292856)]
[New Thread 0x7ffff35ff640 (LWP 3292857)]
[New Thread 0x7ffff2fff640 (LWP 3292858)]
[New Thread 0x7ffff29ff640 (LWP 3292861)]
[New Thread 0x7ffff23ff640 (LWP 3292862)]
[New Thread 0x7ffff1dff640 (LWP 3292864)]
[New Thread 0x7ffff17ff640 (LWP 3292868)]
INFO  2024-04-09 09:49:26,181 [shard 0] seastar - Perf-based stall detector creation failed (EACCESS), try setting /proc/sys/kernel/perf_event_paranoid to 1 or less to enable kernel backtraces: falling back to posix timer.
[New Thread 0x7ffff11ff640 (LWP 3292869)]
[New Thread 0x7fffdbdff640 (LWP 3292872)]
[New Thread 0x7ffff05ff640 (LWP 3292873)]
[New Thread 0x7ffff0bff640 (LWP 3292874)]
INFO  2024-04-09 09:49:26,203 [shard 3] seastar - Created fair group io-queue-0 for 8 queues, capacity rate 2147483:2147483, limit 12582912, rate 16777216 (factor 1.0), threshold 2000, per tick grab 1572864
INFO  2024-04-09 09:49:26,203 [shard 3] seastar - IO queue uses 0.75ms latency goal for device 0
INFO  2024-04-09 09:49:26,203 [shard 3] seastar - Created io group dev(0), length limit 4194304:4194304, rate 2147483647:2147483647
INFO  2024-04-09 09:49:26,207 [shard 0] seastar - Created io queue dev(0) capacities: 512:2000:2000 1024:3000:3000 2048:5000:5000 4096:9000:9000 8192:17000:17000 16384:33000:33000 32768:65000:65000 65536:129000:129000 131072:257000:257000
[New Thread 0x7fffdb7ff640 (LWP 3292879)]
[New Thread 0x7fffdb1ff640 (LWP 3292888)]
[New Thread 0x7fffdabff640 (LWP 3292891)]
[New Thread 0x7fffda5ff640 (LWP 3292894)]
Seastar HTTP server listening on port 6100 ...

Any idea or advice ? Thanks