Some days back I had a short discussion with one of my colleagues with regard to IP Spoofing feature in Performance center. Situation was that I had a ran the load test without checking the IP Spoofing checkbox in Performance center. He was thinking that since I haven’t used the IP Spoofing, request hits will not be spread across the all the servers and I am hitting just one boxes and that’s the reason my test would be considered as invalid.Hmm I said my bad I often forget things. Happens when you work in the big server farm environments.
Then after couple of days, I started studying the environment under which we are testing. To my surprise I came to understand that requests are distributed across servers using least connection algorithm.Least connection algorithm means that your load balancer will send the request to the server which has got least number of clients connection during that point of time. So I thought that let me waste some of my time writing something about IP Spoofing.
IP Spoofing from performance engineering point of view means that each user will be using the unique IP for its communication with the backend components. Backend Components could be anything like load balancer, database servers or web servers etc.So whenever I am running a load test with 10 users with IP Spoofing on, it means that each user will have one unique IP associated with it.
Normally most load testing tools give you a setup guide as how to set up the IP Spoofing feature. However in addition to those guidelines, I often suggest to keep below point in mind,
- All the IP Addresses used for spoofing should be valid and belong to same subnet mask or same LAN or same domain. So IP addresses should be valid and approved by your network administrators.
- It’s always better to have Static IP’s rather than getting the IP’s from the DNS Servers. If you have dynamic IP’s than your IP’s might change frequently depending on how your network has been configured.
- After adding the IP’s ensure that you reboot all your LG’s boxes and confirm that valid IP’s are in fact showing up in the routing table.I think once you do ipconfig/all, it will list you all your added IP’s.
- Ensure that your NIC card is sufficiently big in size to support data flowing for that many IP’s in case if you are running short of LG’s and are having lot many IP’s in the single box.
Also there is certain things which we need to keep in mind, IP Spoofing will not assure you that your requests are spread across the servers or help you in load balancing the requests. There exists application which recognizes the IP of the client and then serves him the content belonging to his region only. Good example of this is Google ads. If you’re based in London and browsing Google ads, then you see ads only from London or your nearby areas where you are residing or browsing from. Of Course the content of the ad will be one which you are searching for.
There also exists certain Load balancing algorithms wherein the requests generated from the same client gets cached and requests goes to the same server box in the backend. Again concept here is something different, they are sometimes called as sticky sessions and this has nothing to do with IP’s. They are scaling algorithms for scaling the web platform.