1

Well I am new to this and I don't know how to do it, so my senior fellows please help!!!!

There is a situation described below:

An HTTP client is sending a request (Request can be of any type, not concerned regarding the request type) that directly hits a Loadbalancer. The Loadbalancer then redirects the traffic, based on the load of the traffic, towards a "Gateway" system running in two V440 Server, GW logic is written in Java, that actually logically routs this request towards another two server nodes which actually process the request.

enter image description here

Now the scene is something like that: there are several parallel connections are established with this Gateway from several HTTP clients. One connection per client. It has been observed that, while making connections to this GW, in case of some clients the CPU utilization is going 98-99%.

Client is creating one connection with the GW on particular port. Opens a socket connection:

ServerSocket _ss = new ServerSocket(_port);
Socket s = _ss.accept();

and then GW waits for the input to come from the client.

Now my question is:

  1. Why this kind of situation is happening, as it seems all fine for rest of the clients and there connections. Only few clients who are creating connections with the GW is making the situation?

  2. Is there anyway we can track this client's IP so that we can understand if this has been occurred by same clients every time?

  3. Is there any resolution for this?

NDeveloper
  • 3,115
  • 7
  • 23
  • 34
  • Please add comments accordingly I might edit the question..Thanks :) – NDeveloper Jul 28 '16 at 09:37
  • 1. I guess this cannot be answered before point 2 is answered, because you need to find out first, what is making those special clients behaving causing the issue. 2. I guess so, but since you give not enough information about your GW, please see [here](http://stackoverflow.com/questions/16558869/getting-ip-address-of-client), [here](http://stackoverflow.com/questions/16163874/get-real-client-ip-in-a-servlet), or [here](http://stackoverflow.com/questions/18350318/what-is-the-right-way-to-get-requests-ip). And point 3 seems to require point 2 and 1 first. – KJaeg Jul 28 '16 at 09:51
  • Hint: I would cut out the important part of your image, so that you remove all that white space around it. Reupload it then, otherwise people will downvote you, I guess. – KJaeg Jul 28 '16 at 09:55
  • Which load balancer are you using? there will be http access logs and if you tweak the logging you can get the source ip, time taken to respond etc – aksappy Jul 28 '16 at 09:58
  • You can't. In general you are only going to get the address of the nearest proxy or NAT device. – user207421 Jul 28 '16 at 10:53
  • @aksappy: its a F5-BIG-IP Load Balancer. Is there anyway we can get the client's IP? – NDeveloper Jul 28 '16 at 10:56
  • @EJP: U mean the client's IP can not be tracked anyway? The thing is the client is making connection with the GW and the request from the client is going through this Load Balancer. Can't we track the client's IP? when it is making connection with the GW? – NDeveloper Jul 28 '16 at 12:01

1 Answers1

0

Since it is not happening for all the clients, we are certainly not going to find an immediate answer for this. However, this is what my limited research on the question yields

Firstly, Question 2

Configure your F5 to capture the client's IP. Since it is HTTP, there are multiple ways of tracking the requests. One is to

sniff the header X-FORWARDED-FOR which will give the client's IP Address

Or try adding this rule in your logging engine

when CLIENT_ACCEPTED { log local0. "clientIP:[IP::client_addr] accessed" }

If you also need other data such as resources you can use one of the other events such as HTTP_REQUEST:

when HTTP_REQUEST { log local0. "clientIP:[IP::client_addr] accessed [HTTP::host][HTTP::uri]" }

Refer link for above here

Secondly, Question 1

For this you need to look at your available traffic statistic mechanisms. I read this, this and this. Enable the statistics, monitor them live, test, mock requests and analyze the output. I do not know of any other options other than this, right now.

Another option, if you can modify your Java program is to include some sort of performance logging mechanism for each request. But this means there is a lot of development and that I do not recommend at all.

Thirdly, Question 3

This is primarily opinion based. As far as I think if you figure out the problem, you can resolve it.

aksappy
  • 3,400
  • 3
  • 23
  • 49