I'm testing a network lib, which uses select for polling socket.
I'm running a stress test, which connects 100 sockets to a server socket (all in the same process), then echoes data back and forth as quickly as possible. If a socket dies, it gets removed. Each loop iteration I print time passed, and the number of active sockets left.
As it runs, I watch the number of sockets slowly decline, until I have a set of 15 sockets left, which seem to keep running happily. Why do the other 85 sockets die? They either raise ECONNRESET, EPIPE or ETIMEDOUT. I imagined sockets connected via localhost would be quite reliable...
Update: The same test between two different machines does _not_ show this same problem. So what's up with localhost?
Friday, November 23, 2007
Subscribe to:
Post Comments (Atom)
Popular Posts
-
These are the robots I've been working on for the last 12 months. They each weigh about 11 tonnes and have a 17 meter reach. The control...
-
So, you've created a car prefab using WheelCollider components, and now you can apply a motorTorque to make the whole thing move along. ...
-
The procedural planet package has been updated to version 1.4, and you can see the new demo here . It features better city light control, be...
-
I have just spent an hour trying to track down a weird bug in some Javascript interpolation code. The offending code looks like this: var n ...
-
Why would I ask that question? Python 3 has been available for some time now, yet uptake is slow. There aren't a whole lot of packages i...
-
I've just finished refactoring an awful C# class. I had been delaying the job for a while because I didn't want to do it. Then, whil...
-
Dear Lazyweb. Imagine a nice RESTful interface for working with Tags. The URL: /tags/ will return a list of all the tags. The URL: /tags/fo...
-
After my last post, I decided to benchmark the scaling properties of Stackless, Kamaelia, Fibra using the same hackysack algorithm. Left axi...
-
Summary: NodeJS wins. Test Program ab -n 10000 -c 5 http://localhost/ Gevent Code from gevent import wsgi class WebServer(object): def a...
-
I've built sites with Django, TurboGears and Pylons. I've come to prefer Pylons. Why? Pylons gets out of the way, and stays out of t...
6 comments:
What about the same test but between two different _processes_ on the same machine?
I get the same issue when running two different processes.
Maximum sustained socket count is 15-20 sockets.
Why, I don't know but I have observerd the same behavior. I suspected that when some queues are full, localhost network just drops the socket.
I imagine that the same would be possible for different machines, but with much more sockets. So: Catch those errors and retry, until the OS is happy. I imagine that that's what we were supposed to do anyway, and the kernel is based on that so it feels free to kill the sockets.
What os. Is it Operating system dependent? Have you tried it on more then one OS?
Could be bandwidth. If you can overload the listening sockets on localhost due to unlimited bandwidth, that could be a problem. Could be a real network actually hides the problem by limiting data transfer speeds?
Perhaps you are using an event loop which is timing out because the writer has filled the outgoing queue before the receiver can empty it?
Post a Comment