Cherrypy cache slower and slower

79 views
Skip to first unread message

tomasz bandura

unread,
Aug 30, 2021, 4:48:49 AM8/30/21
to cherrypy-users
Hello all,

I try to use cache mechanism in my service, so i configure it through config:

'tools.caching.on:True,
'tools.caching.delay':120

Other parameters of 'caching' have default values.

It works perfectly but unfortunately, after some time ( sometimes after 5 minutes, sometimes after 1 hour, but sometime next day) my service becomes definitely slower.

I have workaround - if I invoke clear() method:

cherrypy._cache.clear()

it will start to work fast again.

I don't see warnings or errors in cherrypy log.

Traffic is not too much,  the average size of single response is ~50kB

Parameters of services are:
CPU less than 2%
MEM 0.1%

I cannot see any methods to debug inside my service the size of used memory and response time of getting data from cache.

Has anyone similar problem and can provide me a solution to solving it?

Regards,
Tom

Ps. I use cherrypy 10.2.1 / cheroot 5.3.0 / python 2.7.9

Sviatoslav Sydorenko (@webknjaz)

unread,
Jan 16, 2023, 12:17:12 PM1/16/23
to cherrypy-users
понеділок, 30 серпня 2021 р. о 10:48:49 UTC+2 tomasz....@gmail.com пише:
Has anyone similar problem and can provide me a solution to solving it?


I don't think it's reasonable to expect file-based cache to be fast when the volume
of cached data is growing — file system dir scans get expensive with more inodes.
Instead, I'd expect anybody needing cache to switch to using a specialized backend,
like memcached or redis — they would be much more efficient in this area.
Reply all
Reply to author
Forward
0 new messages