1

I have developed a java client server app based on socket programming. I am now testing multiple clients contacting the server concurrently. On my server I am running eclipse, chrome, mysqld, memcached, mysql admin, mysql query, my java server, and concurrent clients about 5. The payload of request and response is not more than .5kb (at most). About 5 requests per client sequentially. When I run 1 client, things are fine, if I run 5 concurrently my server does not seem to respond.

Now, my question is. I have a vanilla Ubuntu 32 bit installed. Will fine tuning the networking help? Or do you think its possibly a problem with my app itself.

I'm running a dual core processor with 4gb ram, Ubuntu 32bit.

I am looking for good blogs/links to read.

Edit

On a a deeper investigation, I realized that my server was not getting requests. But my client is sending it. Anyway to check if the server has received the request, and decided to drop.

1 Answer 1

1

The nature of the problem seems to be in some concurrency mishandling on the server. Are you sure there is proper locking of objects on the server? Are there no deadlocks? Is your code threadsafe?

5 requests at the same time is nothing - just open 5 tabs in Chrome and you will see.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, that is what I thought. I did a wireshark sniff, and noticed that my request reaches the server. There are Ack's. But for some reason the socket/instream on the server side is not picking up the request object. Yes, its threadsafe. I have locking in the right places. I have other requests/responses which are going thru ok. Just this one request that the serversocket.instream is not picking up. Any hints/thoughts will help.. please keep it on. Thanks.
Just this one request not going through consistently. Same request is passing 50% of the time.
Why don't you try download a sample server / client java code and test if it works. then add feature by feature while testing until it stops working.
Thanks Jim, it was a sync issue on my threads. Basically I was reusing a bunch of threads for new job's. As the job completed, I was not restarting the thread. Also, wasnt a socket problem. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.