Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre Companion

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2016, 07:14 AM   #1
dschnit1
Junior Member
dschnit1 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2016
Location: San Diego, CA
Device: Samsung Galaxy Tab S 10.5
Uploading Large Library to CC Taking Forever

I recently lost my CC library (I told a cleaning app to delete "junk" files without reading which apps were being targeted) and am in the process of reloading my approx. 9100 book library. I am using wireless connection and batches of 400 each time. After loading 3000 books or so, the process slows down to where it literally takes hours to upload each batch. Is this a known phenomenon or is it my system? I am going from a Windows 10 PC to a Samsung Galaxy Tab S running Android 5, storing the library on a SD card.
dschnit1 is offline   Reply With Quote
Old 05-12-2016, 05:41 PM   #2
Sydney's Mom
Wizard
Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.
 
Sydney's Mom's Avatar
 
Posts: 2,896
Karma: 6995721
Join Date: Dec 2008
Location: Idaho, on the side of a mountain
Device: Kindle Oasis, Fire 3d Gen and 5th Gen and Samsung Tab S
I attached my tablet to a library, and simply downloaded the books. Why do you need to do it wirelessly?
Sydney's Mom is offline   Reply With Quote
Advert
Old 05-12-2016, 06:34 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,938
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
WiFi work just as fast as USB for me.
You may be pushing the Indexer (speed) portion of CC with 9100 books.
theducks is offline   Reply With Quote
Old 05-12-2016, 07:05 PM   #4
dschnit1
Junior Member
dschnit1 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: May 2016
Location: San Diego, CA
Device: Samsung Galaxy Tab S 10.5
Quote:
Originally Posted by Sydney's Mom View Post
I attached my tablet to a library, and simply downloaded the books. Why do you need to do it wirelessly?
The Calibre Companion database is not the same as the Calibre library. It has to be imported in some way.
dschnit1 is offline   Reply With Quote
Old 05-12-2016, 08:31 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,938
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Something burped and I just reloaded CC on my TAB2
I sent 985 (EPUB) books via wireless device connection. The whole JOB took 13 minutes (total of 1034 books n the device)

Remember, the metadata in the book is refreshed as part of the task
theducks is offline   Reply With Quote
Advert
Old 05-13-2016, 08:53 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dschnit1 View Post
I recently lost my CC library (I told a cleaning app to delete "junk" files without reading which apps were being targeted) and am in the process of reloading my approx. 9100 book library. I am using wireless connection and batches of 400 each time. After loading 3000 books or so, the process slows down to where it literally takes hours to upload each batch. Is this a known phenomenon or is it my system? I am going from a Windows 10 PC to a Samsung Galaxy Tab S running Android 5, storing the library on a SD card.
Starting with version 5, CC uses Android's "Storage Access Framework" (SAF). This is required by Android to permit you (a user) to put books on an SD card anywhere other than the private app-specific folder.

One problem with the SAF is that it requires CC to talk to another application/system service to read and write files. The performance of these operations is entirely controlled by that other service. Unfortunately, it appears that this "other service" can be very slow on some devices.

I suggest you check the following things:
  • Be sure calibre has enough memory for the library. Run calibre 64 if you can.
  • Check that there aren't other apps running on the device, especially ones that consume network resources.
  • Verify that you have a good wifi connection from your device, and from the computer running calibre if it uses wifi.

Hmmm ... something just occurred to me. Using a book path that specifies a folder hierarchy might improve things dramatically. The reason: SD cards usually run a FAT32 file system. Directories in FAT32 are not indexed, so the operating system (Android) must do a linear search (1, 2, 3, 4 ...) whenever CC creates a file in order to see if the file is already there. The file is never there, so the time required is the worst case: a search of all the elements. Clearly the more files it must look at the slower it will run. For example, in your case with 3000 books, doing the check runs 3,000 times slower than when the library was empty. The open question is "3,000 time what?" If that "what" is a millisecond then each search is now taking 3 seconds. Several searches are required to store a book. Another open question is how the OS caches the information. A bigger cache will give better performance until the number of files exceeds the size of the cache.

To test this I ran an experiment on my Fire 7/rooted running CM12. I cleared CC's library then sent 600 books to the sd card using three different file name templates. The first template stores all the books in the root folder, using no sub-folders. The second template creates a folder per first-author then stores the book. The third creates a folder per first letter of the first author, then a sub-folder per author (all beginning with the same letter), then the book. The results are quite surprising:

Results
In all cases the average time for the first 10 books is .65 seconds.
Code:
Template :: average time per book :: avg last 10 books
{title} - {authors}                                     :: 2.00 secs :: 3.2 secs
{first_author}/{title} - {authors}                      :: 1.15 secs :: 1.2 secs
{first_author:%1.1s}/{first_author}/{title} - {authors} :: 0.65 secs :: 0.65 secs
We see that with the flat template, at the 600th book the time per book is approximately 6 times worse than for the 1st book. For the second template the average time for the last books is approximately 2 times worse. For the third, the average time for last ten books is the same as the first ten.

At 3,000 books and using the first template, the time to store a book should be approximately 16 seconds, or approximately 4 books per minute. For the last template, that time would probably still be very close to 0.65 seconds which is approximately 90 books/minute.

For info: Android internal memory uses a file system that does not have this problem. It is near constant time regardless of the number of files. This is why we don't see these performance problems when using internal memory.

Last edited by chaley; 05-13-2016 at 08:56 AM.
chaley is offline   Reply With Quote
Old 05-14-2016, 01:01 PM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I added the above information to the CC FAQ: I have added a lot of books on an SD card and now downloading books takes forever. What do I do?
chaley is offline   Reply With Quote
Old 05-14-2016, 02:04 PM   #8
Sydney's Mom
Wizard
Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.Sydney's Mom ought to be getting tired of karma fortunes by now.
 
Sydney's Mom's Avatar
 
Posts: 2,896
Karma: 6995721
Join Date: Dec 2008
Location: Idaho, on the side of a mountain
Device: Kindle Oasis, Fire 3d Gen and 5th Gen and Samsung Tab S
Quote:
Originally Posted by dschnit1 View Post
The Calibre Companion database is not the same as the Calibre library. It has to be imported in some way.
I attached CC to Calibre via Content Server, downloaded a book, looked at where it was downloading (not a separate file called CC), and then attached my K5 and downloaded books from 2 separate computers. Probably took 5 minutes for all 9000 books. Now Calibre won't recognize my K5 anymore, but the new books I get can be uploaded via Content Server.

When I open CC, every book is there. In the same order, with the same tags and metadata, as on Calibre. But like I said, I had to fiddle around for awhile, to find out where CC was looking for books. Not intuitive, IMHO.

Last edited by Sydney's Mom; 05-14-2016 at 02:09 PM.
Sydney's Mom is offline   Reply With Quote
Old 05-14-2016, 03:04 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Sydney's Mom View Post
I attached my tablet to a library, and simply downloaded the books. Why do you need to do it wirelessly?
Quote:
Originally Posted by Sydney's Mom View Post
I attached CC to Calibre via Content Server, downloaded a book, looked at where it was downloading (not a separate file called CC), and then attached my K5 and downloaded books from 2 separate computers. Probably took 5 minutes for all 9000 books. Now Calibre won't recognize my K5 anymore, but the new books I get can be uploaded via Content Server.
I am not sure what process you are describing.

CC does not see metadata or books downloaded over USB. CC only sees metadata and books downloaded over one of its connections (wireless device, content server, or cloud). If you download over USB then subsequently connect as a wireless device then CC will try to match the books to calibre's library. This may (or may not) work for EPUB and usually doesn't work for the other formats.

If you download a book with CC then later replace the book file with something new downloaded via USB then CC will "see" the old metadata but the book reader app will see the new book file.
Quote:
When I open CC, every book is there. In the same order, with the same tags and metadata, as on Calibre. But like I said, I had to fiddle around for awhile, to find out where CC was looking for books. Not intuitive, IMHO.
Again, I am not sure what you are doing and what isn't intuitive.

If you are referring to where CC stores book files then the answer is "where you told it to in CC's settings, with the default being the folder "Calibre_Companion" in main memory unless you are using an Amazon device in which case the default is "Books".

If you are referring to something else then could you tell me what it is?
chaley is offline   Reply With Quote
Old 05-19-2016, 08:08 AM   #10
gsparks2
Connoisseur
gsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-books
 
Posts: 93
Karma: 886
Join Date: Apr 2005
Device: Moon+ Reader Pro on Samsung Galaxy S7 Edge International version
I am continuing to download my 24k books into CC. I am up to the G's (title) now.

I am running Android 6 on Samsung S7 Edge Exnos version. I have the Calibre Library on the SD Card. I have the CC folder on the SD card. I connect CC to the local cloud caliber library. The SD card is a 64 gb card that boasts 90 mbs read AND write times. The SD card was formatted by Android.

CC is then reading the book file from SD calibre library then writing the book file to the CC folder on the sd card.

The download times are very very slow. It takes minutes for each book file.

Before I started this I experimented. I put both the Calibre Library and the CC folder in internal memory. It took ~0.2 seconds per book.

Clearly the slowdown is in Android's process for reading/writing to/from the SD card.

I connected to Calibre as a wireless device. Download times are minutes per book when downloading to SD card. Very fast when the CC folder was in internal memory.
gsparks2 is offline   Reply With Quote
Old 05-19-2016, 08:16 AM   #11
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gsparks2 View Post
I am continuing to download my 24k books into CC. I am up to the G's (title) now.

I am running Android 6 on Samsung S7 Edge Exnos version. I have the Calibre Library on the SD Card. I have the CC folder on the SD card. I connect CC to the local cloud caliber library. The SD card is a 64 gb card that boasts 90 mbs read AND write times. The SD card was formatted by Android.

CC is then reading the book file from SD calibre library then writing the book file to the CC folder on the sd card.

The download times are very very slow. It takes minutes for each book file.

Before I started this I experimented. I put both the Calibre Library and the CC folder in internal memory. It took ~0.2 seconds per book.

Clearly the slowdown is in Android's process for reading/writing to/from the SD card.

I connected to Calibre as a wireless device. Download times are minutes per book when downloading to SD card. Very fast when the CC folder was in internal memory.
What file template are you using? I ask because the experiment described in post 6 and in the FAQ answer I added show that things can get *really slow* when there are lots of files in a FAT32 directory.
chaley is offline   Reply With Quote
Old 05-19-2016, 12:31 PM   #12
gsparks2
Connoisseur
gsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-books
 
Posts: 93
Karma: 886
Join Date: Apr 2005
Device: Moon+ Reader Pro on Samsung Galaxy S7 Edge International version
Quote:
Originally Posted by chaley View Post
What file template are you using? I ask because the experiment described in post 6 and in the FAQ answer I added show that things can get *really slow* when there are lots of files in a FAT32 directory.
How do I find what the file template is? Is that in CC or Calibre?

Edit: in Calibre>Preferences>Sending books to devices the Save Template is {author_sort}/{title} - {authors}

Edit: Windows 10 properties of the SD card installed in the phone is "Generic Hierarchical

Last edited by gsparks2; 05-19-2016 at 12:39 PM.
gsparks2 is offline   Reply With Quote
Old 05-19-2016, 01:14 PM   #13
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,362
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by gsparks2 View Post
How do I find what the file template is? Is that in CC or Calibre?

Edit: in Calibre>Preferences>Sending books to devices the Save Template is {author_sort}/{title} - {authors}

Edit: Windows 10 properties of the SD card installed in the phone is "Generic Hierarchical
This is complicated.

The answer depends on what you have chosen in CC's Settings / File names. To quote the FAQ on this subject
Quote:
If none of the CC file name settings are chosen, CC's wireless device connection will use the file name provided by calibre, and CC's Cloud and Content Server connections will use the default CC template.
My guess is that you haven't checked any of the boxes. Because you are using the cloud connection, the default template is
Quote:
{title} - {authors}
which does not use subdirectories. You can easily verify this by looking in the CC folder on your SD card.

I further guess is that you want to use something like the third template from the experiment described in the FAQ answer. That template creates a 3-level hierarchy. The first level is the first letter from the first author's name. I used that because all my authors are LN, FN. If your authors are FN LN then you might choose first_author_sort instead of first_author. The second level is the first author. As before, you might choose first_author_sort. The third is the title - author.

The goal of the exercise is to keep the number of file/directory entries in any given directory as small as possible. To that end, depending on the books in your library, you might choose to use the first letter of title_sort instead of the author for the first level. You would do this if the distribution of books-by-author isn't good (lots of clustering) but the distribution by title is better. You can get an idea of the clustering using the tag browser in calibre: group authors and title by first letter. You could also choose to use 2 letters in the first level, but that runs the risk of creating hundreds of directories at the top level, defeating the purpose of the exercise. Finally, you could choose to add a fourth level: perhaps the first letter of the title (or title_sort) or perhaps the two-letter author just below the top level containing the first letter of the author.
chaley is offline   Reply With Quote
Old 05-19-2016, 01:17 PM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,938
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
remember that EACH devices remembers the DEFAULT templates ONCE USED. (changing the default in Preferences will not affect those)

With CC connected (as a wireless device): right click the device icon (only there when connected): Configure
theducks is offline   Reply With Quote
Old 05-19-2016, 04:38 PM   #15
gsparks2
Connoisseur
gsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-booksgsparks2 has learned how to read e-books
 
Posts: 93
Karma: 886
Join Date: Apr 2005
Device: Moon+ Reader Pro on Samsung Galaxy S7 Edge International version
Thanks!
gsparks2 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from HTML taking forever openletter Conversion 4 04-04-2014 01:16 AM
PRC conversion taking Forever HJanos Conversion 1 02-01-2014 05:14 PM
New ST taking forever first charge? lorraineg57 Barnes & Noble NOOK 3 12-23-2012 01:27 PM
Calbre Mobi to Epub taking forever Alanw888 Conversion 9 07-30-2012 02:54 AM
PDF 2 epub conversion taking forever.. jtndesigner Calibre 7 01-08-2011 04:28 PM


All times are GMT -4. The time now is 09:19 PM.


MobileRead.com is a privately owned, operated and funded community.