Logo
        Login with username, password and session length
  Always stay logged in:

Pages: [1]
  Print  
Author Topic: SMF 2.0 RC1 SQLite tips  (Read 169 times)
aldo
Administrator
Newbie
*****
Posts: 41

View Profile WWW
« on: March 28, 2009, 03:10:51 PM »

As you can see, NoSQL runs on SMF.

SMF 2.0 can run on SQLite, but since SQLite is not the fastest, its a good idea to keep on the down low with features in SMF, here are a couple tips:

1) Do not use database driven sessions.
You can have all PHP session data saved into your database, however, the bigger the SQLite database, the slower it will be. So it is very very wise to have this disabled. If you want, disable this in Admin > Configuration > Server Settings > Cookies and Sessions, then uncheck "Use database driven sessions".

You also may need to empty your session table in your database. You can do this by querying your database with:
Code: [Select]
DELETE FROM {db_prefix}sessions;
Replacing {db_prefix} with your database prefix, which is usually smf_

2) Enable Level 1 Caching.
The more caching that can be done, the less the server has to do, and the less has to be queried... It is recommended you turn caching on to at least Level 1.

Caching can be turned on under Admin > Configuration > Server Settings > Caching
Note that even when it says SMF has not been able to detect a compatible accelerator on your server. SMF will still to file based caching.

3) Disable core features.
Yup, all those under Admin > Configuration > Core Settings. Turn off Calendar, Advanced Profile Fields, Karma, etc. etc.

Why? Features such as the Calendar add at least one more query to each topic load, it checks to see if the topic is linked to the calendar... Profile fields is another query as well, it must get the information about the field to display it... Karma, same way :P

Same way with pretty much each and every one on the page. Yes, they are nice, but what do you want? Slowness? Or fast? :)

4) Disable hostname lookups.
SMF will periodically lookup the hostname from an IP... This can take time, and slow things down on some pages... This isn't SQLite related, and only recommended if you are really desperate. Note that disabling hostname lookups might cause banning to be less effective.

To disable it, go to Admin > Configuration > Server Settings > General and check "Disable hostname lookups"

5) Use a persistent connection.
Using a persistent connection on SQLite can be a great speed improvement, because SQLite doesn't have to continually re-read the database and the index.

This may or may not improve speed performance. For more information check out www.php.net/sqlite_popen

To enable a persistent connection, go to Admin > Configuration > Server Settings > Database and Paths and check "Use a persistent connection"

6) Disable statistics.
You have the option to disable daily statistics, and page views. You should disable them under Admin > Configuration > Features and Options > General and uncheck "Track daily statistics".

These add a couple more queries due to the fact that page views increments a row, besides, you can use other statistical collectors for information like that. ;)

I hope this helps! :)
aldo
Administrator
Newbie
*****
Posts: 41

View Profile WWW
« Reply #1 on: March 28, 2009, 03:49:54 PM »

Oh yes... forgot to mention this...

It is a known problem that for some reason, on Debian/Ubuntu based OS's (110MB, this host, uses Debian) that the session garbage collector does not work, at least not well, if at all. So if you do for some reason decide to keep using database driven sessions it is highly recommended you purge your {db_prefix}sessions table every so often to remove old sessions.

I checked my database today and I had 414 rows! 0.0 removing that much can really increase load times :)
Pages: [1]
  Print  
 
 

Powered by SMF 2.0 RC1-1 | SMF © 2006–2009, Simple Machines LLC
XHTML RSS WAP2
RuNet Theme by [cer]
Page created in 0.181 seconds with 12 queries.