Does a -very- large SimpleCache slow down Xenforo?

Marcus

Well-known member
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.
 
Data Registry can only hold 16MB of serialized array so you can't fill your RAM with it. Also, serializing/deserializing big array takes a lot of time, especially when the system must do it for every request. I wouldn't recommend doing that.
 
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.
 
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?
 
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.
 
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 !
 
Top Bottom