1

I've installed document-viewer and wildcard.foldercontents on my Plone instance: now I can upload multiple files at a time and have a nice pdf, excel, word files preview.

There is only a problem. When I try to upload multiple files at a time, browsing the Plone site is impossible (infinite loading) from another tab or from other workstations: this because of the document-viewer plugin, I suppose (multiple file elaboration?).

When I upload only one file (regardless of the size), browsing the site is possible and without slowdown.

How can I customise wildcard.foldercontents so that it elaborates only one file at a time from the queue?

Massimo Variolo
  • 4,669
  • 6
  • 38
  • 64
  • Impossible to know, possible to speculate... How many zserver instances do you have? How many threads each? And can you direct requests that look like bulk uploads from your front-end to a dedicated instance? – sdupton May 08 '14 at 13:15
  • I have one instance and I don't know how many threads for that one. Can't understand well your last question ... can you make an example? – Massimo Variolo May 08 '14 at 14:41
  • If you have more than one instance (assume you run ZEO), you could run a dedicated instance and use rewriting/proxying rules in your front end web server (apache|nginx) to direct the POST (?) requests that match certain URL/path patterns of your uploads to a dedicated instance. Even if you did not have a load-balancer for multiple instances (e.g. haproxy), you can still use a distinct instance for this if your front end can split out the traffic based on URL. That said, I think you should also you plone.app.async like vangheem suggests. – sdupton May 09 '14 at 16:26

1 Answers1

2

I'm the author of both those products... So you can blame me for any frustrations you have...

Which version of wildcard.foldercontents? In 2.x, it should only upload one at a time. I think in 1.x, it would possibly do 2 at once.

By default, collective.documentviewer does the conversions synchronously. Conversions, depending on the size of the PDF, can take quite a long time.

Now if you're only running one zeo client, which defaults to 2 threads, and upload 2 files simultaneously potentially, then attempt to browse the site after, yes, it will be very slow.

Solutions

  • turn off automatic conversions of PDFs. There should be an option in Site Setup. You will have to later manually convert the document to documentviewer though.

  • or integrate plone.app.async which will do the PDF conversions on a worker zeo client so you won't get bogged down after uploading a bunch

vangheem
  • 3,293
  • 17
  • 18
  • I've wildcard.foldercontents 1.2.4. How can I force it to the latest version? – Massimo Variolo May 09 '14 at 15:23
  • in buildout, pin it to a new version. You can use 2.0a7. It'd look something like "wildcard.foldercontents==2.0a7" – vangheem May 09 '14 at 15:26
  • Maybe I'll choose to manually convert all the updated docs. I'm searching for a solution to do so automatically, running a script that converts at a certain hour all the uncorverted files. Someone can give me a some tips about it? – Massimo Variolo May 11 '14 at 12:49
  • There is an upgrade step that you can manually run by going to /manage -> portal_setup -> upgrades tab -> select collective.documentviewer -> show old upgrades. You could make a script to run with a cron job to automatically do this nightly. – vangheem May 12 '14 at 13:17