Forum Discussion

AndyC_86542's avatar
AndyC_86542
Icon for Nimbostratus rankNimbostratus
Jan 26, 2009

Strange persist behaviour

I have this little section of code in an iRule that decides which of various pools to send an HTTP request to. I wanted to make sure that requests from a single client go through the same proxy server within squid-proxy-pool.

 

 

set sourceIPAddress [IP::client_addr]

 

pool squid-proxy-pool

 

persist source_addr 7200

 

set pResult [persist lookup source_addr $sourceIPAddress]

 

log local0.debug "ip: $sourceIPAddress - persist result: $pResult"

 

 

I thought that this would do what I wanted and just added the last two lines to debug a separate problem. However, when I look at the logs, I get results like the following (dates removed from timestamps for readability):

 

 

16:30:12 ip: 192.168.20.221 - persist result: squid-proxy-pool 172.22.21.250 80

 

16:30:14 ip: 192.168.20.221 - persist result: squid-proxy-pool 172.22.21.249 80

 

16:30:16 ip: 192.168.20.221 - persist result: squid-proxy-pool 172.22.21.249 80

 

16:30:17 ip: 192.168.20.221 - persist result: squid-proxy-pool 172.22.21.249 80

 

16:30:17 ip: 192.168.20.221 - persist result: squid-proxy-pool 172.22.21.250 80

 

 

Am I completely missing the point with persist or is this really spattering requests all over the pool without regard to the source_addr setting?

 

14 Replies