3

On an Ubuntu 16.04 64bit server (kernel 4.4.0-142-generic) with 4gb of RAM and a 2 cores (Intel(R) Pentium(R) CPU G2030 @ 3.00GHz), we run LibreOffice 5.1.6.2 headless to convert HTML to PDF documents.

I noticed a constant, more than 40% cpu usage by the process soffice.bin, even when no document is processed.

The command to start the headless mode we are using is this:

soffice --invisible --accept="socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;" --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore &

I would like to know if is there a way to know what soffice.bin is doing and/or how to fix this.

leonardorame
  • 317
  • 3
  • 14

3 Answers3

1

I would like to know if is there a way to know what soffice.bin is doing

You could try strace(1) to see if that sheds any light.

or how to fix this.

you can only know how to fix it when you know what the issue is. 40% of a core probably isn't much of an issue.

user9517
  • 114,104
  • 20
  • 206
  • 289
  • Thanks, it was easy, I found a Python process was always running at the same time as soffice.bin, so a `ps ax|grep python` gave me the culpit. Fixed. – leonardorame Feb 13 '19 at 21:17
  • 1
    Why did that increase the CPU usage of the OO process? – lukas1994 Aug 14 '19 at 13:10
  • strace won't help to find reasons of high CPU usage. It traces system calls. You need a profiler, not syscall tracer for this. – Ruslan Nov 24 '19 at 09:19
0

I found a Python process was always running at the same time as soffice.bin, so running ps ax | grep python gave me the culpit.

leonardorame
  • 317
  • 3
  • 14
  • This isn't much of an answer. Please explain what you did and why. Did you close all matching python processes? Did you just close one? Which one? Why? Is the issue now fixed? Your answer needs more info please, as I'd really like to solve this LibreOffice problem for myself too. – Gabriel Staples Sep 28 '19 at 21:25
0

No idea why it's happening, but it's bothering me like crazy too. Essentially, LibreOffice is taking up 100% of one core all the time, even when everything is minimized and it's just sitting there!

Meanwhile, here's a workaround to fix it:

  1. SAVE ALL YOUR OPEN DOCUMENTS.
  2. Then, with them still open, go to a terminal and type pkill soffice.bin. This kills the out-of-control process.
  3. Re-open LibreOffice. Let it auto-recover your open documents, and you can now continue working.

You may have to do this every time you have the problem. It's not a permanent fix.

Here's a screenshot showing before doing pkill, and after. Note that even after reopening libreoffice after doing the pkill command, my CPU usage still stayed very low just like it's shown here at the right. In other words, reopening libreoffice did NOT cause the bad CPU behavior again.

enter image description here

Related:

  1. Bug report: go click the little button at the top to indicate you have this problem too (the button is next to where it says "This bug affects you and __ other people": https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1724876
  2. Potential fix: http://webnetkit.com/soffice-bin-using-100-cpu-moodle/; you can find your location of the sofficerc file with: sudo find / | grep sofficerc. For me it's in "/opt/libreoffice6.3/program/sofficerc".
  3. https://ask.libreoffice.org/en/question/128004/why-is-sofficebin-using-60-cpu-with-nothing-open/?answer=210551#post-id-210551
  4. https://ask.libreoffice.org/en/question/158411/libreoffice-6-on-ubuntu-linux-sofficebin-100-cpu-load/

[Keywords: libreoffice soffice.bin 100% cpu usage; libreoffice 100% cpu usage; libreoffice 12% cpu usage (one core on 8 core machine), libreoffice 12.5% cpu usage (1 whole core on 8 core machine), libreoffice 25% cpu usage (100% of one core or cpu on 4 core machine)]