How Do I Test Sticky Sessions Using Linux Curl Commands?
- Prepare required resources.
- Buy three ECSs, one as the client and the other two as backend servers.
- Create a load balancer and add an HTTP listener to the load balancer. Enable sticky sessions when you add the listener.
- Start the HTTP service of the two backend servers.
Log in to a backend server and create a file named 1.file in the current directory to mark this server.
Run the following command in the current directory to start the HTTP service:
nohup python –m SimpleHTTPServer 80 &
Run the following command to check whether the HTTP service is normal:
curl http://127.0.0.1:80
Log in to the other backend server and create a file named 2.file in the current directory.
Run the following command in the current directory to start the HTTP service:
nohup python –m SimpleHTTPServer 80 &
Run the following command to check whether the HTTP service is normal:
curl http://127.0.0.1:80
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.