You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Jason Yang <pe...@gmail.com> on 2019/03/08 00:04:40 UTC

How do I see miss ratio?

Hi community,
     I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio?
By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin.


Best,
Jason



Re: How do I see miss ratio?

Posted by Jason Yang <pe...@gmail.com>.
Great, it works! Thank you! You are amazing :) 


Jason 


> On Mar 20, 2019, at 17:29, Bryan Call <bc...@apache.org> wrote:
> 
> It takes a few seconds for the stats to sync when using zero.  I tried clear and it didn’t work for me and I filed an issue on it yesterday.
> 
> Again, you have to wait a few seconds for traffic_server to startup and sync the stats before running traffic_top.
> 
> Stats are synced every 5 seconds by default.
> 
> -Bryan
> 
> 
> 
>> On Mar 19, 2019, at 3:11 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi Bryan, 
>>     Thank you for your quick reply! I have tried both approaches you have propose. 
>> using traffic_ctl to zero the stat, but it does not have any effect, I tried to zero several statistics, then I get the value, it is still there. I have also tried traffic_ctl metric clear, it does not working either. 
>> 
>> As for removing records.snap, 
>> it gives me "Error getting stat: proxy.process.http.100_responses when calling TSRecordGetInt() failed: file "traffic_top/stats.h", line 281” 
>> sometimes the error disappears if I rerun traffic_top, but sometimes it will always give this error. 
>> Any thoughts why? 
>> 
>> 
>> 
>> Best, 
>> Jason 
>> 
>> 
>>> On Mar 19, 2019, at 12:42, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>>> 
>>> You can zero a metric while running ATS by running this command:
>>> sudo /usr/local/bin/traffic_ctl metric zero proxy.process.http.completed_requests
>>> 
>>> Or you can shutdown ATS and remove the metrics file:
>>> 09:37:25 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
>>> proxy.process.http.completed_requests 1000000
>>> 09:39:25 homer:~$ sudo /usr/local/bin/trafficserver stop
>>> Stopping traffic_manager:                                  [  OK  ]
>>> Stopping traffic_server:                                   [  OK  ]
>>> 09:39:36 homer:~$ sudo rm /usr/local/var/trafficserver/records.snap
>>> 09:40:08 homer:~$ sudo /usr/local/bin/trafficserver start
>>> Starting Apache Traffic Server:                            [  OK  ]
>>> 09:40:23 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
>>> proxy.process.http.completed_requests 0
>>> 
>>> -Bryan
>>> 
>>> 
>>> 
>>>> On Mar 18, 2019, at 10:34 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>>> 
>>>> Hi Bryan, 
>>>>     How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you! 
>>>> 
>>>> 
>>>> Best, 
>>>> Jason 
>>>> 
>>>> 
>>>>> On Mar 11, 2019, at 12:07, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>>>>> 
>>>>> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
>>>>> 
>>>>> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
>>>>> 
>>>>> -Bryan
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>>>>> 
>>>>>> Hi community, 
>>>>>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>>>>>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>>>>>> 
>>>>>> 
>>>>>> Best, 
>>>>>> Jason 
>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Bryan Call <bc...@apache.org>.
It takes a few seconds for the stats to sync when using zero.  I tried clear and it didn’t work for me and I filed an issue on it yesterday.

Again, you have to wait a few seconds for traffic_server to startup and sync the stats before running traffic_top.

Stats are synced every 5 seconds by default.

-Bryan



> On Mar 19, 2019, at 3:11 PM, Jason Yang <pe...@gmail.com> wrote:
> 
> Hi Bryan, 
>     Thank you for your quick reply! I have tried both approaches you have propose. 
> using traffic_ctl to zero the stat, but it does not have any effect, I tried to zero several statistics, then I get the value, it is still there. I have also tried traffic_ctl metric clear, it does not working either. 
> 
> As for removing records.snap, 
> it gives me "Error getting stat: proxy.process.http.100_responses when calling TSRecordGetInt() failed: file "traffic_top/stats.h", line 281” 
> sometimes the error disappears if I rerun traffic_top, but sometimes it will always give this error. 
> Any thoughts why? 
> 
> 
> 
> Best, 
> Jason 
> 
> 
>> On Mar 19, 2019, at 12:42, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>> 
>> You can zero a metric while running ATS by running this command:
>> sudo /usr/local/bin/traffic_ctl metric zero proxy.process.http.completed_requests
>> 
>> Or you can shutdown ATS and remove the metrics file:
>> 09:37:25 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
>> proxy.process.http.completed_requests 1000000
>> 09:39:25 homer:~$ sudo /usr/local/bin/trafficserver stop
>> Stopping traffic_manager:                                  [  OK  ]
>> Stopping traffic_server:                                   [  OK  ]
>> 09:39:36 homer:~$ sudo rm /usr/local/var/trafficserver/records.snap
>> 09:40:08 homer:~$ sudo /usr/local/bin/trafficserver start
>> Starting Apache Traffic Server:                            [  OK  ]
>> 09:40:23 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
>> proxy.process.http.completed_requests 0
>> 
>> -Bryan
>> 
>> 
>> 
>>> On Mar 18, 2019, at 10:34 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> Hi Bryan, 
>>>     How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you! 
>>> 
>>> 
>>> Best, 
>>> Jason 
>>> 
>>> 
>>>> On Mar 11, 2019, at 12:07, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>>>> 
>>>> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
>>>> 
>>>> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
>>>> 
>>>> -Bryan
>>>> 
>>>> 
>>>> 
>>>>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>>>> 
>>>>> Hi community, 
>>>>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>>>>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>>>>> 
>>>>> 
>>>>> Best, 
>>>>> Jason 
>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Jason Yang <pe...@gmail.com>.
Hi Bryan, 
    Thank you for your quick reply! I have tried both approaches you have propose. 
using traffic_ctl to zero the stat, but it does not have any effect, I tried to zero several statistics, then I get the value, it is still there. I have also tried traffic_ctl metric clear, it does not working either. 

As for removing records.snap, 
it gives me "Error getting stat: proxy.process.http.100_responses when calling TSRecordGetInt() failed: file "traffic_top/stats.h", line 281” 
sometimes the error disappears if I rerun traffic_top, but sometimes it will always give this error. 
Any thoughts why? 



Best, 
Jason 


> On Mar 19, 2019, at 12:42, Bryan Call <bc...@apache.org> wrote:
> 
> You can zero a metric while running ATS by running this command:
> sudo /usr/local/bin/traffic_ctl metric zero proxy.process.http.completed_requests
> 
> Or you can shutdown ATS and remove the metrics file:
> 09:37:25 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
> proxy.process.http.completed_requests 1000000
> 09:39:25 homer:~$ sudo /usr/local/bin/trafficserver stop
> Stopping traffic_manager:                                  [  OK  ]
> Stopping traffic_server:                                   [  OK  ]
> 09:39:36 homer:~$ sudo rm /usr/local/var/trafficserver/records.snap
> 09:40:08 homer:~$ sudo /usr/local/bin/trafficserver start
> Starting Apache Traffic Server:                            [  OK  ]
> 09:40:23 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
> proxy.process.http.completed_requests 0
> 
> -Bryan
> 
> 
> 
>> On Mar 18, 2019, at 10:34 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi Bryan, 
>>     How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you! 
>> 
>> 
>> Best, 
>> Jason 
>> 
>> 
>>> On Mar 11, 2019, at 12:07, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>>> 
>>> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
>>> 
>>> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
>>> 
>>> -Bryan
>>> 
>>> 
>>> 
>>>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>>> 
>>>> Hi community, 
>>>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>>>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>>>> 
>>>> 
>>>> Best, 
>>>> Jason 
>>>> 
>>>> 
>>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Bryan Call <bc...@apache.org>.
You can zero a metric while running ATS by running this command:
sudo /usr/local/bin/traffic_ctl metric zero proxy.process.http.completed_requests

Or you can shutdown ATS and remove the metrics file:
09:37:25 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
proxy.process.http.completed_requests 1000000
09:39:25 homer:~$ sudo /usr/local/bin/trafficserver stop
Stopping traffic_manager:                                  [  OK  ]
Stopping traffic_server:                                   [  OK  ]
09:39:36 homer:~$ sudo rm /usr/local/var/trafficserver/records.snap
09:40:08 homer:~$ sudo /usr/local/bin/trafficserver start
Starting Apache Traffic Server:                            [  OK  ]
09:40:23 homer:~$ /usr/local/bin/traffic_ctl metric get proxy.process.http.completed_requests
proxy.process.http.completed_requests 0

-Bryan



> On Mar 18, 2019, at 10:34 PM, Jason Yang <pe...@gmail.com> wrote:
> 
> Hi Bryan, 
>     How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you! 
> 
> 
> Best, 
> Jason 
> 
> 
>> On Mar 11, 2019, at 12:07, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>> 
>> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
>> 
>> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
>> 
>> -Bryan
>> 
>> 
>> 
>>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> Hi community, 
>>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>>> 
>>> 
>>> Best, 
>>> Jason 
>>> 
>>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Jason Yang <pe...@gmail.com>.
Hi Bryan, 
    How can I reset the statistics? I have tried traffic_server -Cclear and delete everything under var/log and var/trafficserver, but it seems the statistics is not reset. Thank you! 


Best, 
Jason 


> On Mar 11, 2019, at 12:07, Bryan Call <bc...@apache.org> wrote:
> 
> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
> 
> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
> 
> -Bryan
> 
> 
> 
>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi community, 
>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>> 
>> 
>> Best, 
>> Jason 
>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Bryan Call <bc...@apache.org>.
Fresh is both RAM and disk.  To get the RAM cache ratio it is traffic_top also.

The colors are kinda arbitrary.  I "borrowed" the idea from dstat.

For percentages:
100 - 90  -> red
90 - 80  -> yellow
50 - 80 -> blue
0 - 50 -> geen

For numbers:
Trillion -> red
Billion -> red
Million -> yellow
Thousand -> cyan (should be blue)
<= 1000 -> green

There is a bug in the timing information.

-Bryan



> On Mar 12, 2019, at 12:16 PM, Jason Yang <pe...@gmail.com> wrote:
> 
> Hi Bryan and community, 
>     Thank you for your reply! Does the fresh indicates disk hits or both ram+disk hits? 
> 
> And also a few other questions, 
> 	What does the different colors mean in the output?  
> 	What does Fresh(ms) mean, the sentence on the documentation site does not make sense to me (it says the average loop up time for fresh cache serving), but I am seeing a value of 400k, I don’t think each lookup takes 400k ms. 
> 
> 
> Thank you!
> Jason 
> 
> 
>> On Mar 11, 2019, at 12:07, Bryan Call <bcall@apache.org <ma...@apache.org>> wrote:
>> 
>> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
>> 
>> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
>> 
>> -Bryan
>> 
>> 
>> 
>>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>>> 
>>> Hi community, 
>>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>>> 
>>> 
>>> Best, 
>>> Jason 
>>> 
>>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Jason Yang <pe...@gmail.com>.
Hi Bryan and community, 
    Thank you for your reply! Does the fresh indicates disk hits or both ram+disk hits? 

And also a few other questions, 
	What does the different colors mean in the output?  
	What does Fresh(ms) mean, the sentence on the documentation site does not make sense to me (it says the average loop up time for fresh cache serving), but I am seeing a value of 400k, I don’t think each lookup takes 400k ms. 


Thank you!
Jason 


> On Mar 11, 2019, at 12:07, Bryan Call <bc...@apache.org> wrote:
> 
> It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.
> 
> Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.
> 
> -Bryan
> 
> 
> 
>> On Mar 7, 2019, at 4:04 PM, Jason Yang <peter.waynechina@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hi community, 
>>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
>> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
>> 
>> 
>> Best, 
>> Jason 
>> 
>> 
> 


Re: How do I see miss ratio?

Posted by Bryan Call <bc...@apache.org>.
It depends on what you mean as a miss.  If you mean that it has to go to the origin no matter what (even revalidating the cache entry) then it should be 100 - fresh.

Also, if you hit "a" you can get the stats from since the server started and you can get the number of incoming requests and requests going go the origin.

-Bryan



> On Mar 7, 2019, at 4:04 PM, Jason Yang <pe...@gmail.com> wrote:
> 
> Hi community, 
>      I see there is such tool traffic_top, but I am confusing which of the number shows miss ratio? 
> By miss ratio I mean the number that miss_ratio*request_traffic=traffic_to_origin. 
> 
> 
> Best, 
> Jason 
> 
>