sqlite 3 可以处理多少个连接?
让大量的人在使用 sqlite 时连接到您的网站是一个好主意吗?
编辑:我正在一个关键的 ruby on Rails 应用程序中使用它,该应用程序可能有数百个并发用户。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,SQLite 有两个相关的独特重要属性:
在进行多次插入时,如果将它们全部包装在一个事务中,您将获得更好的性能。如果插入是单独完成的,SQLite 会在每次插入时等待磁盘盘片完全旋转,以便可以从磁盘读回插入的数据并进行验证。
写入 SQLite 文件时,整个文件被锁定,这可能会导致写入器饥饿。 这种情况在 SQLite 3 中得到了改善。
SQLite网站称SQLite适合中小流量网站,具有较低的 OLTP 功能。这约占所有网站的 95%。
There are two important properties unique to SQLite that I know of that are relevant:
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.
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.