Re: [sqlite] Geeting degrade while using multhi threading

2017-09-08 Thread Clemens Ladisch
Karthi M wrote:
> "Internally SQLite uses locks to serialize calls by multiple threads."
> if this is case then how can we achieve concurrency?

In general, SQLite serializes accesses to the same connection object.

To get higher concurrency (for reading), use multiple connections.


Regards,
Clemens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Geeting degrade while using multhi threading

2017-09-08 Thread Simon Slavin


On 8 Sep 2017, at 10:23am, Karthi M  wrote:

>Thanks for the Reply..
>"Internally SQLite uses locks to serialize calls by multiple threads."
> if this is case then how can we achieve concurrency?
>we are using 50 threads and 1500 time it is called for 30min.

When making a change (COMMIT) SQLite locks the entire database.  But not for 
very long.  Perhaps a few milliseconds.  If all 50 threads are trying to write 
at the same time you may have problems.  If just a few of them write each 
minute then you should be okay.

Simon.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Geeting degrade while using multhi threading

2017-09-08 Thread Karthi M
HI

Thanks for the Reply..
"Internally SQLite uses locks to serialize calls by multiple threads."
if this is case then how can we achieve concurrency?
we are using 50 threads and 1500 time it is called for 30min. At
initial stage it works fine at some point of time the performance degrades.
   Is there any way  to achieve maximum concurrency? Please suggest...

Thanks
Karthi M



On Wed, Sep 6, 2017 at 8:53 PM, Jens Alfke  wrote:

>
>
> > On Sep 4, 2017, at 7:22 AM, Senthil Kumar Chellappan
>  wrote:
> >
> > I am using only select operation ,but it gets degreaded(response time)
> when
> > i calls the API thur multi threading
>
> Internally SQLite uses locks to serialize calls by multiple threads. If
> multiple threads are trying to access it at once, that will increase
> overhead since the locks have to control the access. Usually this isn't
> noticeable since the overhead for acquiring a single lock is very low, but
> it depends on how many calls are being made.
>
> You'll need to give more details of what calls you're making, on how many
> threads, and how many times they're called.
>
> —Jens
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Geeting degrade while using multhi threading

2017-09-06 Thread Jens Alfke


> On Sep 4, 2017, at 7:22 AM, Senthil Kumar Chellappan 
>  wrote:
> 
> I am using only select operation ,but it gets degreaded(response time) when
> i calls the API thur multi threading

Internally SQLite uses locks to serialize calls by multiple threads. If 
multiple threads are trying to access it at once, that will increase overhead 
since the locks have to control the access. Usually this isn't noticeable since 
the overhead for acquiring a single lock is very low, but it depends on how 
many calls are being made.

You'll need to give more details of what calls you're making, on how many 
threads, and how many times they're called.

—Jens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users