0
votes

I installed a swift service and was trying to know the capability of handling concurrent request. So I created massive amount of threads in Java, and sent it via the RestFUL API

Not surprisingly, when the number of requests climb up, the program started to throw out exceptions.

Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:378) at sun.net.www.http.HttpClient.openServer(HttpClient.java:473) at sun.net.www.http.HttpClient.(HttpClient.java:203)

But can anyone tell me how that time outhappened? I am curious of how SWIFT handles those requests. Is that by queuing the requests and because there are too many requests in the queue and wait for too long time and it's just get kicked out from the queue? If this holds, does it mean that it's an asynchronized mechanism to handle requests?

Making it more interesting, sometimes I also got Connection refused error and Error writing request body to server, would that be another observation that can be explained by the mechanism?

Thanks.

1

1 Answers

1
votes

Swift uses Proxy-Server to address too many concurrent request & when you are designing a Swift infrastructure you can add/remove as per your need although its recommended to have 2 in a production environment.

Also if you are benchmarking swift you should use ssbench https://github.com/swiftstack/ssbench

OpenStack also has SDK available for various programming languages including Java https://wiki.openstack.org/wiki/SDKs#Java

Hope it helps.