Mobileread
Calibre Server Times Out for Large Books
#1  Bob Bobaloobob 07-24-2018, 05:37 PM
My Calibre server works fine for small items, but times out on anything a little bit large. I get the error message "...could not open the page because the server stopped responding" on the client. It's running on OS X 10.11.6 (El Capitan).

Any thoughts on the best way to approach this problem?
Reply 

#2  kovidgoyal 07-25-2018, 12:13 AM
Look at the server logs. And what page is timing out? Book size should not affect anything other than trying to read the book in the browser.
Reply 

#3  Bob Bobaloobob 07-25-2018, 10:38 AM
Here's what I'm seeing in the logs: [My notes are in square brackets]

Access Log:
[Accessing Calibre server from a device at 192.168.1.138]
192.168.1.138 port-62584 - 25/Jul/2018:08:16:35 -0500 "GET /get/PDF/2751/Calibre_Library_1 HTTP/1.1" 200 61300738
[Requesting a large PDF]

Error Log:

calibre server listening on 0.0.0.0:8080
OPDS feeds advertised via BonJour at: 192.168.1.24 port: 8080
Unhandled exception in state: State: write_buf Client: 192.168.1.138:62584 Request: GET /get/PDF/2751/Calibre_Library_1 HTTP/1.1
Traceback (most recent call last):
File "site-packages/calibre/srv/loop.py", line 569, in tick
File "site-packages/calibre/srv/http_response.py", line 572, in write_buf
File "site-packages/calibre/srv/http_response.py", line 371, in write
File "site-packages/calibre/srv/sendfile.py", line 90, in sendfile_to_socket_async
IOError: (57, 'Socket is not connected')
Reply 

#4  kovidgoyal 07-25-2018, 10:51 PM
According to that log the connection is being disconnected in the middle of a send. Something in the network path between the client and the server is likely causing that. I suggest you start by simply running the server on localhost and connecting to it o localhost and verify that it works there.
Reply 

#5  Bob Bobaloobob 07-27-2018, 04:54 PM
It works fine from localhost, but if it's time-dependent, I haven't given it much of a test. A larger PDF I was using for testing was 172MB, which seems to take about three seconds over localhost. Over the WiFi, much more time would be required, so if there's a short time limit for the server...

I looked in Calibre for server settings and I didn't find any time settings I could increase. I don't mind manipulating server setup files, but I haven't done that in years.

Should I be looking in /etc/apache2/conf/extra?
Reply 

#6  gbm 07-27-2018, 05:40 PM
Quote Bob Bobaloobob
It works fine from localhost, but if it's time-dependent, I haven't given it much of a test. A larger PDF I was using for testing was 172MB, which seems to take about three seconds over localhost. Over the WiFi, much more time would be required, so if there's a short time limit for the server...

I looked in Calibre for server settings and I didn't find any time settings I could increase. I don't mind manipulating server setup files, but I haven't done that in years.

Should I be looking in /etc/apache2/conf/extra?
Change your port number.

Check and see if you have a conflict with two processes using the same port.
Code
netstat -an -Ptcp | grep tcp4
bernie
Reply 

#7  kovidgoyal 07-27-2018, 10:38 PM
It's not a server timeout, the error you posted from the logs indicates that the server still thinks the connection is open, which means that something else has closed the connection. But if you wish to increase server timeouts, the options are in the advanced section of Preferences->Sharing over thenet at the bottom.

You can also try disabling zero copy transfers in the same place.
Reply 

#8  Bob Bobaloobob 07-28-2018, 04:21 PM
Thanks for the help, Kovid. You are correct. The problem was with my iPad and large files, not the server. Below are some tips that may help others with the same problem.

When transferring large (~200MB and larger) PDF files from Calibre server to iPad:
* Disable Zero Copy Transfers at the server (as Kovid explains above).
* Empty the cache of whatever browser you use.
* Have patience. And, even when the transfer seems complete, you may have to wait a minute before the "Share" button is responsive, and wait a bit more until the "Copy to Adobe Acrobat" button will respond and copy your PDF into Acrobat.
Reply 

Today's Posts | Search this Thread | Login | Register