Discussion:
[uWSGI] uWSGI cache hit/miss info?
Skip Montanaro
2018-05-11 13:02:34 UTC
Permalink
I've got a couple small uWSGI caches in my application, and can see how
many elements they contain, but have no idea what their hit/miss ratios
are. Is there some API for that? I thought perhaps uwsgitop might display
it, but I saw nothing there.

Thanks,

Skip Montanaro
Roberto De Ioris
2018-05-12 06:26:04 UTC
Permalink
Post by Skip Montanaro
I've got a couple small uWSGI caches in my application, and can see how
many elements they contain, but have no idea what their hit/miss ratios
are. Is there some API for that? I thought perhaps uwsgitop might display
it, but I saw nothing there.
Thanks,
Skip Montanaro
_______________________________________________
uWSGI mailing list
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Hi, you can try this:

https://github.com/goir/uwsgicachetop
--
Roberto De Ioris
http://unbit.com
Skip Montanaro
2018-05-14 16:24:22 UTC
Permalink
Skip> I've got a couple small uWSGI caches in my application, and can see
how
Skip> many elements they contain, but have no idea what their hit/miss
ratios
Skip> are. Is there some API for that? I thought perhaps uwsgitop might
display
Skip> it, but I saw nothing there.

Roberto> Hi, you can try this:
Roberto> https://github.com/goir/uwsgicachetop

Thanks. I gave it a whirl. I installed it using pip in a Python3-based
Conda environment. While it installed, when I ran it, I got an error about
'reduce' not being defined. Clearly hasn't been ported to Python 3. No
problem, run it in a Python 2 env. Once installed and run using Python 2,
it displays a number of columns, though the values in the MISS column are
always zero, making the various derived values not-so-useful. That it
doesn't crash suggests that it's likely reading the data correctly from the
socket, but that uWSGI itself isn't keeping track of cache misses, at least
not automatically.

Is there some action I am supposed to take when the request reached my code
(indicating a cache miss)? I saw nothing here:

http://uwsgi-docs.readthedocs.io/en/latest/Caching.html

which suggests that. This seems like the sort of thing uWSGI itself can
keep track of (and more efficiently than me). Am I missing something?

Skip Montanaro
Roberto De Ioris
2018-05-15 16:27:55 UTC
Permalink
Post by Skip Montanaro
Skip> I've got a couple small uWSGI caches in my application, and can see
how
Skip> many elements they contain, but have no idea what their hit/miss
ratios
Skip> are. Is there some API for that? I thought perhaps uwsgitop might
display
Skip> it, but I saw nothing there.
Roberto> https://github.com/goir/uwsgicachetop
Thanks. I gave it a whirl. I installed it using pip in a Python3-based
Conda environment. While it installed, when I ran it, I got an error about
'reduce' not being defined. Clearly hasn't been ported to Python 3. No
problem, run it in a Python 2 env. Once installed and run using Python 2,
it displays a number of columns, though the values in the MISS column are
always zero, making the various derived values not-so-useful. That it
doesn't crash suggests that it's likely reading the data correctly from the
socket, but that uWSGI itself isn't keeping track of cache misses, at least
not automatically.
Is there some action I am supposed to take when the request reached my code
http://uwsgi-docs.readthedocs.io/en/latest/Caching.html
which suggests that. This seems like the sort of thing uWSGI itself can
keep track of (and more efficiently than me). Am I missing something?
Skip Montanaro
_______________________________________________
Hi, the cache stats are exposed by the stats-server so you can directly
telnet to it and get back a json. You can check there if the data are
correct.

Let me know what you discover :)
--
Roberto De Ioris
http://unbit.com
Skip Montanaro
2018-05-15 17:12:48 UTC
Permalink
Yeah, been there, done that. Misses are always zero... :-(

I just added a "_stats_" cache to my server and maintain my own hits and
misses.

Skip
Post by Roberto De Ioris
Post by Skip Montanaro
Skip> I've got a couple small uWSGI caches in my application, and can see
how
Skip> many elements they contain, but have no idea what their hit/miss
ratios
Skip> are. Is there some API for that? I thought perhaps uwsgitop might
display
Skip> it, but I saw nothing there.
Roberto> https://github.com/goir/uwsgicachetop
Thanks. I gave it a whirl. I installed it using pip in a Python3-based
Conda environment. While it installed, when I ran it, I got an error
about
Post by Skip Montanaro
'reduce' not being defined. Clearly hasn't been ported to Python 3. No
problem, run it in a Python 2 env. Once installed and run using Python 2,
it displays a number of columns, though the values in the MISS column are
always zero, making the various derived values not-so-useful. That it
doesn't crash suggests that it's likely reading the data correctly from the
socket, but that uWSGI itself isn't keeping track of cache misses, at least
not automatically.
Is there some action I am supposed to take when the request reached my code
http://uwsgi-docs.readthedocs.io/en/latest/Caching.html
which suggests that. This seems like the sort of thing uWSGI itself can
keep track of (and more efficiently than me). Am I missing something?
Skip Montanaro
_______________________________________________
Hi, the cache stats are exposed by the stats-server so you can directly
telnet to it and get back a json. You can check there if the data are
correct.
Let me know what you discover :)
--
Roberto De Ioris
http://unbit.com
_______________________________________________
uWSGI mailing list
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
Loading...