You can use a session cookie to track whether a request should go to a specific pool. You can set the cookie in HTTP_RESPONSE using ‘HTTP::cookie insert $cookie_name value $cookie_value path / domain $domain’. You can check for the cookie in HTTP_REQUEST using [HTTP::cookie value $cookie_name].
If you want to “randomly” send x% of requests without a cookie to a specific pool, you can use rand(). The third example in this codeshare entry shows how to implement what you’ve described.
Example 3 - Send 90% of requests to poolA, 5% to poolB and 5% to poolC. Use a session cookie to persist clients to the same pool over their HTTP session
If you want to prevent users from manually specifying the pool they go to, you could encrypt the cookie using a custom HTTP profile and the cookie to encryption option.
1:I also want to know whether I can store this ratio in a datagroup,then other team can update this ratio in GUI
from 0% to 100%
in the ends,I wanna 100% traffic to the new pool ,while 0% to old pool ,can we achieve this?i do not think there is any problem in reading ratio from data group/class.