Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (794)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  java.net.SocketTimeoutException: connect timed out  (Read 36135 times)
0 Members and 1 Guest are viewing this topic.
Offline princec

« JGO Spiffy Duke »


Medals: 1101
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #30 - Posted 2014-11-11 22:37:23 »

Yeah, it's all good... it works just fine with SSL connection too - seems to add maybe another 100ms latency but that's entirely liveable with for a nice secure protocol. I can actually ditch all the SSL stuff from serverside Java code if I'm going to use load balancers as they come with SSL termination built-in. So it's exactly the same as it was before, but it's just using a nice (and thoroughly tested!) binary protocol now and pretty simple client/server code. Telling the client to retry is trivial and already in the abstraction... I was just rather worried about its unreliability with only me testing it under no load whatsoever. Now it seems it's just me. Gah.

Time to move to Linode I think.

Cas Smiley

Offline Riven
Administrator

« JGO Overlord »


Medals: 1364
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #31 - Posted 2014-11-11 22:45:34 »

100ms of latency doesn't seem bad, but it's 100ms of 1 CPU core on the server doing heavy work. With a dozen handshakes per second your typical VPS will grind to a halt - it doesn't scale well. You really need loadbalancers with hardware-accelerated SSL or you're just moving the bottleneck from one machine to another, and those SSL loadbalancers typically aren't as cheap as a VPS. My initial protocol did a secure handshake without SSL, but it was rather complex - I can understand you prefered the simplicity of SSL, and I hope it works out.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline princec

« JGO Spiffy Duke »


Medals: 1101
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #32 - Posted 2014-11-11 22:55:41 »

It does actually use that hacked bit of SSL code you wrote though it's still sending a fair amount of stuff back and forth. I could change it in theory to use a custom handshaking mechanism but sticking to SSL means we can really easily just palm the problem off on, say, a $20/mo Linode node balancer and that'll handle it. I don't think we're really going to get that much traffic any time soon...

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
Administrator

« JGO Overlord »


Medals: 1364
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #33 - Posted 2014-11-11 23:01:09 »

Linodes Loadbalancers have a pretty crappy reputation and are pricy too. Simply use HAproxy on a basic Linode instance Pointing

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline princec

« JGO Spiffy Duke »


Medals: 1101
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #34 - Posted 2014-11-11 23:11:26 »

Though I did come across this tidbit:

https://www.imperialviolet.org/2010/06/25/overclocking-ssl.html

and this:

https://www.imperialviolet.org/2011/02/06/stillinexpensive.html

Cas Smiley

Offline Riven
Administrator

« JGO Overlord »


Medals: 1364
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #35 - Posted 2014-11-11 23:22:24 »

Try Java's default SSL Engine, it's very computationally expensive Smiley

As for my protocol being SSL based - it used a sliver of SSL to create a 'token based session' that the bulk of the I/O could use - without needing SSL, while retaining guarantees about which peers were communicating. That's where the complexity was introduced, that I refered to. Anyway, maybe Linode improved their Loadbalancers (back in 2012 - ancient history, I know - they slowly degraded to up to 4s-6s (!!) latency on handshake overhead). Even Java's SSL Engine beats that hands down! It's worth a try again. Getting familiar with, and correctly configuring HAproxy is probably more 'expensive' than messing about with a Linode Loadbalancer for a few hours. But you know me - I'd gladly spend a day tinkering to save a few bucks per month. persecutioncomplex

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline prasanna_iitr

Innocent Bystander





« Reply #36 - Posted 2019-07-10 04:27:32 »

Please advise if you able to find any solution to this problem. I  am facing a similiar issue.
Offline ddyer
« Reply #37 - Posted 2019-07-10 04:52:10 »

Implement reader thread that fills a queue, and a writer thread driven from a queue.
You will never see timeouts again, but it won't fix whatever other bugs there are
In the code generating or absorbing data.
Pages: 1 [2]
  ignore  |  Print  
 
 

 
hadezbladez (3218 views)
2018-11-16 13:46:03

hadezbladez (1157 views)
2018-11-16 13:41:33

hadezbladez (3185 views)
2018-11-16 13:35:35

hadezbladez (632 views)
2018-11-16 13:32:03

EgonOlsen (3922 views)
2018-06-10 19:43:48

EgonOlsen (4406 views)
2018-06-10 19:43:44

EgonOlsen (2624 views)
2018-06-10 19:43:20

DesertCoockie (3443 views)
2018-05-13 18:23:11

nelsongames (3575 views)
2018-04-24 18:15:36

nelsongames (4622 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!