CPU consumption on a JSON JAVA application -
on quad core cpu machine 4 gb ram, tomcat 6 installed, java 1.6. have software handles communication gateway. handles incoming json messages using jersey (1.19), deserialize , call client send message server using jersey (1.19) rest libraries. handles incoming request other server, serialize json , send outside. 10 users connected, sending 600 byte of message every 4 seconds. global cpu consumption reaches 30%. normal expected behaviour? how can handle more users?
code:
private string executetogameengine(string text, string urlresource){ clientresponse response = null; try { clientconfig clientconfig = new defaultclientconfig(); client client = client.create(clientconfig); webresource webresource = client.resource(urlresource); response = webresource .accept(mediatype.text_plain) .type(mediatype.text_plain) .post(clientresponse.class, text); if (response == null) { // error... } else if (response.getstatus() != 200) { // error... } return response.getentity(string.class);
}
we installed visualvm analyze problem, suggestion?enter image description here