meltwater / served

A C++11 RESTful web server library
MIT License
710 stars 173 forks source link

minimal served example fails to pass apache bench test #26

Closed nikhedonia closed 6 years ago

nikhedonia commented 7 years ago

The server src/examples/hello_world/main.cpp fails to accept any request sent by ApacheBench. It seems like served does perform the handshake correctly. Curl and webbrowsers are less fuzzy and report no issue.

 ab -v2 http://localhost:8123/ 
This is ApacheBench, Version 2.3 <$Revision: 1796539 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)...INFO: GET header == 
---
GET /hello HTTP/1.0
Host: localhost:8123
User-Agent: ApacheBench/2.3
Accept: */*

---
apr_socket_recv: Connection refused (111)

Furthermore I also tested with https://github.com/tarekziade/boom It reports that roughly 10% of requests are answered with errorcode 413. If I enable -O3 the errorrate increases to above 90%

cjgdev commented 6 years ago

I appreciate this was reported a very long time ago, but running ab -v2 http://127.0.0.1:8123/ worked for me. Can you give that a try and see whether you get the same result?