[OpenSIPS-Users] Does OpenSIPS use SQLite configuration to hold on queries when database is locked?
Ionut Ionita
ionutionita at opensips.org
Wed Jun 29 16:02:53 CEST 2016
Hi Rodrigo,
I am the one who implemented SQLITE module. First of all I wasn't
aware of the BUSY_TIMEOUT option, but still if I was I wouldn't use it
and I'll explain why. Setting such a parameter will cause the OpenSIPS
processes, except the one that has the lock on the database, to sleep
for X ms. After those X ms the database may be locked again and you have
to sleep again for that amout of seconds, even though at some point in
that sleeping interval you may have had the change to get the lock. In
the current implementation, all processes keep trying to get the lock,
avoiding dead times, when they could have had the lock but they were
sleeping. We can't do anything else while the database is locked since
we need to process the current message in order to get to the next one.
SQLITE has limitations based on the fact that for each query the whole
database is locked, and to explain that I would like to quote official
documentation:
/"However, client/server database engines (such as PostgreSQL, MySQL, or
Oracle) usually support a higher level of concurrency and allow multiple
processes to be writing to the same database at the same time. This is
possible in a client/server database because there is always a single
well-controlled server process available to coordinate access. If your
application has a need for a lot of concurrency, then you should
consider using a client/server database. But experience suggests that
most applications need much less concurrency than their designers
i//magin//e./*//*/"[0]
/ We would be glad to implement such a mechanism if our software
would benefit from it, but in my humble opinion it would bring nothing
useful for our module.
/
/[0] http://www.sqlite.org/faq.html#q5
Regards,
Ionut Ionita
OpenSIPS Developer
On 06/28/2016 11:52 PM, Rodrigo Pimenta Carvalho wrote:
>
>
> Dear OpenSIPS users,
>
>
> In my software, programmed in QT (framework for C++) and handling data
> with a SQLite database, I have used this:
>
>
> pDb.setConnectOptions("QSQLITE_BUSY_TIMEOUT=6000");
>
>
> That is, if SQLite complains that "database is locked" sometime when
> my software tries to register some datum there, such database keeps
> the query paused (hold on), and then after 6 seconds let the query
> execute. This mechanism is transparent for my software and certify
> that the query will be tried every 6 seconds until it complete
> successfully.
>
>
> Is there something similar to it in OpenSIPS ? That is, does OpenSIPS
> uses some kind of configuration provided by SQLite?
>
> If not, why the developers team decided not to use such mechanism?
>
>
> Any comment will be very helpful!
>
>
> Thanks a lot!
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20160629/9ff5228e/attachment.htm>
More information about the Users
mailing list