libasync icon indicating copy to clipboard operation
libasync copied to clipboard

apr_socket_recv: Connection refused (111)

Open donglei opened this issue 9 years ago • 10 comments

I've used libasync to my project, dub run is ok, but I benachmarked with apache ab tool , showing

Benchmarking localhost (be patient)...apr_socket_recv: Connection refused (111)

command : ab -n 100 -c 100 -k http://localhost:8081/index

how can I fixed that?

donglei avatar Apr 27 '15 09:04 donglei

I think this benchmark would be more appropriate for vibe.d with libasync driver. Benchmarking libasync would be a little like benchmarking your kernel's accept, send or recv functions because it's really just an abstraction that puts you a function call away from those, and it's not doable using ab unless you're draining HTTP buffers because libasync isn't really equipped for that. You'd have to write the HTTP parser and buffers on top of it (which is, like writing a replica of vibe.d)

etcimon avatar Apr 27 '15 11:04 etcimon

I want to write a lightweight web framework based on libasync It contains only request(http parser) route template and respone. but QPS is not high。 I want to use multi threads to fixed it,how can I do?

donglei avatar May 06 '15 05:05 donglei

The best way to implement multi-threading would be on top of the request. You can start a new thread and process your request there. But I think you might be testing it wrong, but first what is the QPS? You should know that the apache bench isn't the best tool to test this out, you should probably use multiple machines over the network instead of the loopback

etcimon avatar May 06 '15 12:05 etcimon

Sorry,it is not QPS . RPS is Requests per second.

donglei avatar May 07 '15 05:05 donglei

I will need the source code and the operating platform to further assess this situation. There could be many reasons for a low throughput.

etcimon avatar May 07 '15 12:05 etcimon

Can you give me IM tools account , I want to add you as a friend~

donglei avatar May 08 '15 05:05 donglei

Yes, my skype is etcimon

etcimon avatar May 08 '15 12:05 etcimon

How to use multi-threading with eventloop ,can you show me an example, thank you!

donglei avatar May 14 '15 01:05 donglei

I would need some time to prepare this. Is there a reason why it wouldn't be preferable to use vibe.d with libasync driver?

etcimon avatar May 14 '15 13:05 etcimon

I would like to know the whole framework, do not simply use someone else's

donglei avatar May 15 '15 01:05 donglei