MyBB Community Forums

Full Version: Data cache config: files slower than db?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys

On Friday my board got shutdown by my hoster and was not reopened until today because they say my board slowed down the whole database server with too many queries. The database server has always been slow and I can't imagine that my board has s.th. to do with that but for the moment I have to live with this hoster so now I am searching for possible solutions.

One thing I did was deactivate ajax-pm-notify and myshoutbox since they query the database regularly. I had set them both to refresh every 20 seconds.

Now I received an e-mail from the support that the table "myprefix_datacache" is the cause of the problem. What should I do? I did an optimization of all db tables but now I am considering changing the data-cache to filesystem instead of db. What are the disadvantages if I do that? Is filesystem always slower than db or what else could be a reason not to do that?

Any help would be appreciated.

Greetings
Atnun
You can try a different cache handler if they offer it and see if there's an immediate speed increase, I'm not sure if it'd definitely be quicker or slower but I can get a developer to check this thread to see if they know. The shoutbox would probably have been causing more problems than the datacache table.

How many hits does your site get?? The datacache table is queried on every page load, but so are other tables like sessions and users, for logged in people at least. Unless you're getting tens of thousands of hits a day or something, the datacache table shouldn't really be causing a problem.
(2010-12-20, 10:06 AM)MattRogowski Wrote: [ -> ]You can try a different cache handler if they offer it and see if there's an immediate speed increase

Thanks for your reply. They don't offer memcache, xcache or eaccelerator only option I have would be to switch to filesystem usage (cache folder).

(2010-12-20, 10:06 AM)MattRogowski Wrote: [ -> ]How many hits does your site get??

We are only a small site with 70 users so that shouldn't be a problem Wink
I am aware that it's probably a hoster issue but I can't switch them at the moment so I try to optimize things a little. Not sure if my users are happy without the shoutbox though Big Grin
You can try files, but MyBB still uses the database for writes even if you select any other cache handler. This is because other cache handlers are considered unreliable; for example there is no guarantee that a file can actually be written (permission problems). And in that case it still needs the database entry to have something to fall back to.

However if your database is slow in general, I suggest you switch to a decent host.

As for shoutbox, those are a popular candidate for causing high server load. So if you're using a Shoutbox plugin that's also using the datacache, that may be your root cause actually.