• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Does a -very- large SimpleCache slow down Xenforo?

Marcus

Well-known member
#1
I am thinking of putting lots of stuff in SimpleCache - as its so simple :D SimpleCache is available on every page in XenForo. So is there a problem if I really put lots of stuff there (100 MB, 1 GB, 20 GB)? I have 64 GB RAM and only use a fraction of it.
 

Jake Bunce

XenForo moderator
Staff member
#3
The simpleCache is automatically loaded on every page so it's good for small data because it saves you a query. But if the data is large then you are talking memory footprint. If you don't need the data on every page then the extra memory footprint might not be worth it.

For data that is not needed on every page you might consider creating your own registry entry:

http://xenforo.com/community/thread...ll-users-over-several-runs.33600/#post-382901

Using your own registry entry adds one query when you access the data.
 

cclaerhout

Well-known member
#4
The simpleCache is automatically loaded on every page so it's good for small data because it saves you a query. But if the data is large then you are talking memory footprint. If you don't need the data on every page then the extra memory footprint might not be worth it.

For data that is not needed on every page you might consider creating your own registry entry:

http://xenforo.com/community/thread...ll-users-over-several-runs.33600/#post-382901

Using your own registry entry adds one query when you access the data.
I didn't see this message, thanks Jake ! The way to use that registry record is as easy as to use the simplecache!
I've just have a few other questions:
  • When you say "small data", how small is that? 200, 2000, 20000 characters? I think I've read in one post (may be yours) that the data were stored in db as 'mediumtext' (16777215 characters).
  • So in theory if coders want to store datas they have to share that amount and can't go over?
  • And just to check, is it the same with the registry solution?
 

Jake Bunce

XenForo moderator
Staff member
#5
I didn't see this message, thanks Jake ! The way to use that registry record is as easy as to use the simplecache!
I've just have a few other questions:
  • When you say "small data", how small is that? 200, 2000, 20000 characters? I think I've read in one post (may be yours) that the data were stored in db as 'mediumtext' (16777215 characters).
  • So in theory if coders want to store datas they have to share that amount and can't go over?
  • And just to check, is it the same with the registry solution?
Yes, all registry records are limited to 16M of data by the column type. An individual registry record can be up to 16M. The entire simpleCache (being its own record) can be up to 16M. Keep in mind that the simpleCache is shared by all addons so don't be a hog.

If you are loading 1M or more of data into the simpleCache then you need to start thinking about memory footprint. That's arbitrary though.
 

cclaerhout

Well-known member
#6
Yes, all registry records are limited to 16M of data by the column type. An individual registry record can be up to 16M. The entire simpleCache (being its own record) can be up to 16M. Keep in mind that the simpleCache is shared by all addons so don't be a hog.

If you are loading 1M or more of data into the simpleCache then you need to start thinking about memory footprint. That's arbitrary though.
明白! Perfectly clear. Thank you !