3 ms·
Number of open connections is a little bit meaningless until they're actually under load, sending and receiving packets in a real world situation. I'd agree, J
by axod 17y ago
Number of open connections is a little bit meaningless until they're actually under load, sending and receiving packets in a real world situation.
I'd agree, Java+NIO is a great system. Extremely fast+scalable.
- davidw 17y agoNot knowing much about Java's NIO, how do you handle 'long running calculations'? One of the great things about Erlang is that you can sit there doing some big huge long loop, and it won't block the rest of the system because it's got an internal scheduler. One way to do that kind of thing with C or Java is simply to manually divide your big long calculation into smaller chunks that yield control at regular, brief intervals. Does Java provide anything higher level?
- axod 17y agoWhat sort of long calculations? If you're doing massive number crunching, you could just have a queue->thread->callback for it if it's not easy to break up into bite size chunks... I don't know of anything else built in.
- davidw 17y agoOk, fair enough. What's neat about Erlang is that you just write your code and don't have to worry about divying it up, or sending stuff of to a queue. I suppose one possible disadvantage of the Erlang way is if the scheduler is divying resources up equally, you could be 'thrashing' between too many "processes", rather than working your way through a FIFO queue that's going to only work on so many things at one time. But at that point you could just write a queue system in Erlang...
- sho 17y agoWell, it's not that meaningless. Comet is basically long polling; those connections aren't really doing much of anything until something turns up on the back end to be pushed down them, at which point the connection is usually closed and then re-requested by the client. Maybe with the occasional ping, I've seen some people do that too. How much memory and CPU is required to simply hold open the connection and sit there is definitely of interest to people. Of course, I'd like to see real world tests too, but that might be rather difficult to pull off without specially written, extremely efficient code on the test side.
- axod 17y agoSure. It's the "basic" level requirement. Holding open a tcp connection should be pretty cheap though unless something is badly wrong.