Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many connections can sqlite 3 handle?

Is it ever a good idea to let a large amount of people connect to your website while it is using sqlite?

edit: I am using it in a critical ruby on rails application that may have hundreds of concurrent users.

like image 335
johnny Avatar asked Aug 31 '10 15:08

johnny


1 Answers

There are two important properties unique to SQLite that I know of that are relevant:

  1. When doing multiple inserts, you will get better performance if you wrap them all in a single transaction. If the inserts are done individually, SQLite waits for the disk platters to rotate around completely on each insert, so that the inserted data can be read back from the disk and validated.

  2. When writing to a SQLite file, the entire file is locked, which can cause writer starvation. This situation improved in SQLite 3.

The SQLite website says that SQLite is suitable for small to medium traffic websites, with low OLTP capability. This accounts for about 95% of all websites.

like image 142
Robert Harvey Avatar answered Oct 18 '22 03:10

Robert Harvey