Author |
Message |
drathbun Board Member
Joined: 24 Jul 2008
Posts: 729 Location: Texas
|
Posted: Tue Oct 28, 2014 8:53 am Post subject: Re: I'm going to fork phpbb2 |
|
|
I added a lot of caching to phpBB2, including tables like the config table, smilies, flags, and other items that change very rarely. One thing to understand is you're exchanging one form of I/O for another. Take the config table for an example. If that table is queried on every single page, and changes very seldom, you can write the config file out as an array and simply read it in. That means disk I/O occurs on every page load.
Alternatively, you have to run a query against the database, which would (you would think) require first a database call, and then the database has to go retrieve the information from where it is stored on disk. That would imply that caching the file to disk and reading it directly should be more efficient because it skips the database call.
But if the database is smart and the table is small, then the config table contents are permanently loaded into the database cache which is in memory. Now what is faster: reading direct from disk, or querying the database which is reading from RAM instead?
Ultimately I went ahead and cached the file to disk, but I never really answered that question to my satisfaction. Other small tables (smilies and flags as mentioned above) are treated the same way. _________________ phpBBDoctor Blog |
|
Back to top |
|
|
nostro Board Member
Joined: 16 Jul 2012
Posts: 54
|
Posted: Tue Oct 28, 2014 12:20 pm Post subject: Re: I'm going to fork phpbb2 |
|
|
That's true, for simple queries like 'select * from phpbb_config' probably letting mysql do it's job and cache it would be faster... well, in that case that would be true if that table didn't include the rand_seed that is changed often (I moved it to a separate table). |
|
Back to top |
|
|
StarWolf3000 Board Member
Joined: 10 Jun 2010
Posts: 175 Location: Germany
|
Posted: Sat Nov 01, 2014 8:49 am Post subject: Re: I'm going to fork phpbb2 |
|
|
You can get a tight permance boost on queries if you use MySQL's Views instead of plain SELECTs. This is not needed for data that does not change very often, like the board configuration.
Depending on the intended boards' size, it can be useful to set the prefix__sessions to either MEMORY (for smaller boards) or InnoDB storage engine. |
|
Back to top |
|
|
nostro Board Member
Joined: 16 Jul 2012
Posts: 54
|
Posted: Sat Nov 01, 2014 9:00 am Post subject: Re: I'm going to fork phpbb2 |
|
|
Thanks, I'll try that mysql views thing... I'll google it first, I have not heard of it until now |
|
Back to top |
|
|
Vendethiel Board Member
Joined: 26 Oct 2014
Posts: 251
|
Posted: Sat Nov 01, 2014 1:23 pm Post subject: Re: I'm going to fork phpbb2 |
|
|
Quote: | Ultimately I went ahead and cached the file to disk, but I never really answered that question to my satisfaction. Other small tables (smilies and flags as mentioned above) are treated the same way. | There's no way parsing an array is going to be slower than making a request through a network (and back) - In my experience, caching is much much faster ! |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Wed May 06, 2015 2:49 am Post subject: Re: I'm going to fork phpbb2 |
|
|
How is the progress on this project?! _________________ Love your data! Back it up! |
|
Back to top |
|
|
nostro Board Member
Joined: 16 Jul 2012
Posts: 54
|
Posted: Wed May 06, 2015 11:26 am Post subject: Re: I'm going to fork phpbb2 |
|
|
Just slightly. I'm currently working in two new themes/templates made from scratch for my phpbb forum (one for mobile), once they are finished (one month or so) I'll adapt them to be used in the fork, then I'll continue work in the fork project. |
|
Back to top |
|
|
|