Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


On 19/10/2017 17:09, Jens Tröger wrote:
Thanks Matthew!

That’s close to what I’m using. However, would you mind sharing your “close document” code, as well 
as shutting down the soffice process?

In that context, it looks like you’re using the soffice process as the server? How about projects like 
listed in this question: https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=75523  What about 
scalability as per this question: https://forum.openoffice.org/en/forum/viewtopic.php?f=6&t=74002

Thank you,
Jens

Well, in the context of the previously included code, cleanup was a matter of:

  os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
  shutil.rmtree (tempDir)

which is I think not what you want - it was purely used to run a test, then terminated with prejudice when the result was known.

Something like you mentioned earlier should be sufficient to make the instance (one soffice.bin and wrapper script) go away cleanly in the normal case:

  document.close(True)
  desktop.terminate()


Whether running a persistent server process instead would suit your needs better is something you'll have to test with your actual use case. Without knowing exactly what it is you're trying to achieve, I can only speculate in general terms: On the one hand, running everything through a persistent LO instance as server will give you reasonably low latency if it's something time sensitive, but it may struggle to make use of the ample threads of modern processors if there are many parallel requests to service; on the other hand, running everything on individual, isolated instances means you will incur a relatively high fixed cost for each startup (even with cached user profiles, it will still take some time to load a whole new LO), but may ultimately scale to use CPU resources better if each individual transaction is fairly long running and CPU intensive.

Regards
Matthew Francis

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.