Re: ts-lua questions

2016-12-09 Thread Shu Kit Chan
I honestly don't know if your model can support million lines. I guess you just have to stress test to make sure. For the redis way, I find that to be fine for some modest work load (e.g. 5K rps) . But beyond that, you just need to stress test that and perhaps need to tune it or use other similar

Re: ts-lua questions

2016-12-09 Thread Di Li
Hi Kit, Thanks for the suggestion, do you think it will be a problem to use the ts.stats way to maintain a key value pair, I don’t need that to be persistent, as long as it can be shared between requests. For example, if I just want to do a access control and use the src_ip + domain as key , a

Re: ts-lua questions

2016-12-09 Thread Shu Kit Chan
Yeah. That's right. It won't work the way you intended. you probably need an external source of truth as your trigger. e.g. a local redis store. So you have some cron to keep checking some URL and update a key in the local redis store. And then you have lua script to check the key in the local red

Re: ts-lua questions

2016-12-09 Thread Di Li
looks like so far only thing that’s not request lifetime is that ts.stat_create and find Thanks, Di Li + + SHIELD :: Self-Service Load-Balancer (LB) and Web App Firewall (WAF) + http://shield.apple.com

Re: ts-lua questions

2016-12-09 Thread Di Li
I just did a quick test with counter = counter + 1 , and seems that global lua table has the same lifetime as the request. is there any way I can store data beyond the request lifetime ? Thanks, Di Li > On Dec 9, 2016, at 10:23 AM, Di Li wrote: > > Hey Kit, > > > Thanks for taking time

Re: ts-lua questions

2016-12-09 Thread Di Li
Hey Kit, Thanks for taking time to respond my emails, I still have some confusions, hopefully you can help me understand more about those pieces. The background here is we are trying to do a forward proxy, the reason I was thinking about using ts.schedule is that it can keep get the latest our