jeudi 26 février 2015

preventing socket server/ client performance issues



I am tailoring my php website to connect to my java server by creating a socket connection every single web request. Within each request, I am sending about six to ten total Strings back and forth. Say a user logs in, clicks around ten times, it is not uncommon for that user to have created ten socket connections causing the transaction of ~80 Strings between server and client. I notice absolutely zero performance issues with my one connection as I test.


Before I advance any further, I want to make sure this isn't a terrible design. Imagine I had 500 users, all click ten times in ten seconds total... that's (500 * 10 * ~8) 40,000 Strings being sent or received in 10 seconds.


If I proceed with this method, is it possible to run into issues down the road? I am not factoring in hardware, strictly numbers here.


A possible solution, if this is a problem, is to take those 3-5 Strings, and send them as one. Then the server will separate them, and respond accordingly. This is my first stab at a server/ client concept, so I am really unsure on how to move forward. Perhaps there are standards that are known to preform the best.


Thank you for your input.


Brent




Aucun commentaire:

Enregistrer un commentaire